LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB PNP Notification

Hello,
I want to notify my application (programming with LabVIEW) when my device
was plugged in the USB port. In TestPoint or Visual Basic I managed this by
listening to the message queue. When I gut the message WM_DEVICECHANGE I
post a message to my application window. The code for this is packed in a
DLL. One of the parameters of the DLL is the handle of my application
window.
Could everyone help me to implement the DLL (call) in LabVIEW. How could I
get the handle for the application window and how could I listen to the
message queue of this window. My application normaly runs under WindowsXP.

Thank you in advance Birgit
0 Kudos
Message 1 of 3
(3,219 Views)

You can get the handle for your LabVIEW VI window by calling the FindWindowA function from user32.dll. You will need to pass the title of your VI (everything and exactly how it appears on your VI's title bar) to the function.

Look this function up in Windows SDK or on MSDN.

Hope this helps.

Regards,

Khalid

0 Kudos
Message 2 of 3
(3,219 Views)
Hi,

There is a very good example that includes a bunch of tools to manage windows; you should be able to get the Window Handle using this VIs.

the example is called Windows API Function Utilities (32-bit) for LabVIEW, you should be able to find it here.

Windows API Function Utilities (32-bit) for LabVIEW


Regards,

Juan Carlos
N.I.
0 Kudos
Message 3 of 3
(3,219 Views)