Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 let's 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

  • *Experts*
Posted

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

 

If you're trying to send it a message, use SendMessage. You'll 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 you're 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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...