LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Receiving windows messages in LabView

Hi there,
I'm looking for a possibility to receive user defined messages from a second
application in LabView. The second application does not have the LV window's
handle and should broadcast the message like this:

bool check = ::SendMessage(HWND_BROADCAST, WM_USER, 0, 0);

I tried the Windows Message Queue Library but LV doesn't seem to recognize
the message...
Any suggestions? (LV6, W2K)

Thanks,
\Ulli.
0 Kudos
Message 1 of 3
(3,203 Views)
Are you sure you can broadcast message in this way ?
Maybe your first window isn't getting this message.
If you want to send a message, why not just send to
the first window. Your first window has a window
handle, right? The first parameter in SendMessage
is the window handle of the reciving window. The
window handle of the second application (sending
window) is not needed here.


George Zou
http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 2 of 3
(3,202 Views)
"zou" schrieb im Newsbeitrag
news:506500000005000000F6970000-1027480788000@exchange.ni.com...
> Are you sure you can broadcast message in this way ?

Yes, I can detect this message sent by the "nonLabView-application" inside
the WMQ-Lib, if I check not only for the LV-windows handle but also for the
desired WM_USER (had to modify the dll).

> Maybe your first window isn't getting this message.
> If you want to send a message, why not just send to
> the first window. Your first window has a window
> handle, right? The first parameter in SendMessage
> is the window handle of the reciving window. The
> window handle of the second application (sending
> window) is not needed here.

But if the second application does not know the handle o
f my LV application
then I can broadcast the message.
In the meantime I found out, that the broadcasted message is placed into the
LV application's message queue but has a different window handle.
I tried to get the handle to the nonLV's application and checked for
messages with that handle as well (dll modified) but this did not work.
So if there is no further idea I'm probably going to implement it the way I
described it above...

Thanks for your reply,
\Ulli.

>
>
> George Zou
> http://gtoolbox.yeah.net
0 Kudos
Message 3 of 3
(3,203 Views)