LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to receive a Send Message call from another app?

I need some help receiving a SendMessage call from another app.  I can't modify the other app, so I must work with what it does.  The other app will execute a SendMessage(whandle, GlobalCustomMessage, 0, 0) after a buffer is filled so that I can work on the contents of the buffer.  How do I code the receiving end in CVI to get the message?
0 Kudos
Message 1 of 2
(3,657 Views)

I believe you have to hook into the main window message queue, there is a way to do that in CVI, so that you see all of the "Windows" messages.  It's the RegisterWinMsgCallback function.

 

I have never been able to get this to work very well, as I recall it turns out there are some subtle rules as far as some messages getting intercepted/dispatched before you see them in the queue.   There are some threads on this topic on this forum though maybe from years ago.  It could be NI has made changes since I last tried to use this function.

 

And I believe you can only hook into the message queue for the main panel, not to any child panels.

 

If it's too painful to get the Windows messaging working you could try some form of Win32 IPC such as mailboxes, or a pipe.

 

Menchar

Message Edited by menchar on 09-08-2009 03:52 PM
Message 2 of 2
(3,652 Views)