Windows message

Heike

Well-known member
Joined
Jun 5, 2002
Messages
56
I developed an EXE (VB.NET) which is called by a COOL:Plex program. Now I got the following job: if something specific happens "send a windows message with number 42" because that lets e.g. refresh a TreeView (in that COOL:Plex program). My question now is: how can I do that? I have no idea because I never worked with windows messages before (not in C neither in VB 6.0).
After searching everywhere in the www I seem to know that I must use the API-Function SendMessage. Does anyone have a simple example how to use it?

Thx
 
Are you trying to send a message to the COOL:Plex program or is it trying to send something to you?

If youre trying to send it a message, use SendMessage. Youll need the window handle (hWnd) of the window. You can get it through the API FindWindow or a similar function. This MAY not work, depending on the windows that COOL:Plex creates. FindWindow finds top level windows and if the one youre sending a message to is farther down, you may have to loop and find it. Assuming COOL:Plex is designed to be interfaced to, they should have made it pretty simple.

SendMessage also takes a message number, 42 in your case. The wParam and lParam can be 0 unless the COOL:Plex docs say to pass something else.

-Nerseus
 
Back
Top