07-26-2014 04:35 AM
Hope that when a device plugging in a COM or the USB port on the PC, the CVI application can catch the event. Due to the application is a windows service mode, so I think use the GetCVIWindowHandle() function to specify a particular Window to receive the message. But no idea to achieve this.
David
07-27-2014 09:51 PM
HI,
you can try WM_DEVICECHANGE.
http://www.codeproject.com/Articles/14500/Detecting-Hardware-Insertion-and-or-Removal
Hope to be helped somewhat to you.
07-28-2014 08:10 PM
ls`s method is the key. You can also read this paper about the WM_DEVICECHANGE event in CVI. https://decibel.ni.com/content/docs/DOC-22836
07-28-2014 11:12 PM
Hello,
Due to the code phase will work in the Windows service mode, so the visible panel will be not a good way. I think that to use GetCVIWindowHandle() to specify a OS window, and use RegisterWinMsgCallback() to receive the WM_DEVICECHANGE, but no idea. Do you have any suggestion?
David