LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending custom windows messages (SDK) with LabVIEW

To communicate with other applications, especially LabWindows/CVI I want to send and receive windows messages. In LabWindows/CVI that can be done quite simple. But for LabVIEW I only found ways to receive messages (standard messages like WM_MOUESEMOVE etc.). Every standard message has a number, so I would like to send a message with my own number.
For the communication between CVI and LabVIEW, NI recommnends to use ActiveX or Datasocket. Windows Messages would be much faster. Can someone help me out?
0 Kudos
Message 1 of 5
(2,560 Views)
Use a Call Library Node for this.

Put one down on the code page then right click and choose "configure". For the DLL you will need to point it to user32.dll from your systems folder and use the function SendMessage. You should be able to find a reference to this API from the CVI help files...
Message 2 of 5
(2,551 Views)
Thanks! When I try to configure the Call Library Node, I can choose between SendMessageW and SendMessageA. What's the difference? And is there a list which Win32 Datatype corresponds to which datatype in LabVIEW? What is for example a HWND hWnd, UINT Msg, WPARAM wParam or a LPARAM lParam?
0 Kudos
Message 3 of 5
(2,540 Views)
Windows functions come in two flavors: ANSI (A) and Unicode (W). Since LV is ANSI you should choose A.
As for the datatypes, there is no list, but you can look here for some more details.

___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(2,535 Views)
Just yesterday Ed Dickens showed me an example that listed many of the C datatypes and their LabVIEW version. I am not sure what version of LabVIEW first had this, but it is in 7.1.

In the example finder (Help -> Find Examples), search for DLLs. The one that you want to look at is Call DLL.vi.

Hope that this helps,
Bob
0 Kudos
Message 5 of 5
(2,527 Views)