Window Messages WM_COPYDATA with Ateasy 8

Cyril P.
Meung Sur Loire, France

Jul 17, 2013
23 Posts

0  |  0  

Re: Window Messages WM_COPYDATA with Ateasy 8

Hello,

is there a way to use Window Message SendMessage() WM_COPYDATA with Ateasy 8 to control another application?

I need to control another application which allow to do that with the SendMessage() with system-defined message WM_COPTYDATA, but I'm not familiar with Window Messages and I don't know if it is possible to do it with Ateasy 8.

Thanks for your help.
Cyril

Victor B.
Lake Forest, CA

Jul 17, 2013
93 Posts

0  |  0  

Re: Window Messages WM_COPYDATA with Ateasy 8

Hi Cyril,

Yes, the SendMessage APIs are part of User32.dll and the functions can be called from ATEasy.  Link to the User32.dll and define the functions that you will need to use in your ATEasy project (or import the Windows.h file if you want all the functions defined).

Regards,
Victor Brode

Cyril P.
Meung Sur Loire, France

Jul 18, 2013
23 Posts

0  |  0  

Re: Window Messages WM_COPYDATA with Ateasy 8

Hi Victor,

thanks for your reply.
I know that SendMessage API is part of User32.dll and I have define it in ateasy, but the MSDN doc is not so much clear and I don't know exactly how I can used it in ateasy.
I have done some trials and it is not working yet. SendMessage return always 0.

Regards,
Cyril

Victor B.
Lake Forest, CA

Jul 18, 2013
93 Posts

0  |  0  

Re: Window Messages WM_COPYDATA with Ateasy 8

Hi Cyril,

I wonder if the simplest method for transferring data between applications wouldn't be using the system clipboard? You can access it from ATEasy using functions like Clipboard.SetText("Foo") or myImage=Clipboard.GetPicture()

If you have already imported the relevant User32 APIs, then I would suggest adapting an example like http://msdn.microsoft.com/en-us/library/windows/desktop/ms649009(v=vs.85).aspx or posting the code here.

Regards,
Victor Brode

Cyril P.
Meung Sur Loire, France

Jul 19, 2013
23 Posts

0  |  0  

Re: Window Messages WM_COPYDATA with Ateasy 8

Hi Victor,

The application I would to communicate with is a commercial one. After reading again its documentation I finally understand how it work and what I should do to communicate with.
For now, I am able to send message to this application and it works.
I am focusing now how to get the anwser from this application.

Edit: It seems to be much complicated to receive a message from the other application than sending it.
I tried to implement the SetWindowLong to change the WndProc to mine, but Ateasy doesn't like and crash.
If you have a hint for me, I'll thankful.

Regards,
Cyril

Cyril P.
Meung Sur Loire, France

Jul 19, 2013
23 Posts

0  |  0  

Re: Window Messages WM_COPYDATA with Ateasy 8

Previous post edited.

Victor B.
Lake Forest, CA

Jul 19, 2013
93 Posts

0  |  0  

Re: Window Messages WM_COPYDATA with Ateasy 8

There should be nothing to prevent you from receiving messages to your ATEasy application. You would use the same library to to check the message queue and retrieve the messages. See this article for more examples: http://msdn.microsoft.com/en-us/library/windows/desktop/ms644928(v=vs.85).aspx

Regards,
Victor Brode



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]