| View previous topic :: View next topic |
| Author |
Message |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sat Nov 12, 2005 3:22 am Post subject: Device Notification [Resolved] |
|
|
Can anyone explain how I'd go about using RegisteringDeviceNotification within a VDS application?
Or WM_DEVICECHANGE?
Or maybe point me to a thread that may help.
FYI I'm trying to monitor/detect when a USB device is connected. _________________ cheers
Dave
Last edited by DaveR on Sat Nov 26, 2005 4:46 pm; edited 1 time in total |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sun Nov 13, 2005 11:54 am Post subject: |
|
|
Mac, you're a legend (if I can get it working
After searching for DBT_DEVICEARRIVAL I found Mac's @sendmsg codes... post in the Knowledge Base.
http://www.vdsworld.com/forum/viewtopic.php?t=426
I don't know why my previous searches for WM_DEVICECHANGE never found it...
I've just waisted a whole weekend considering switching from VDS to C or VB!  _________________ cheers
Dave |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Mon Nov 14, 2005 5:08 am Post subject: |
|
|
Using RegisterDeviceNotification in VDS would be a bit interesting because of the structures, but you can at least see when a device is plugged in/unplugged.
All this will do is fill the list with a bunch of 7's here, as RegisterDeviceNotification isn't used, but it's a start for you at least.
| Code: |
OPTION MSGEVENT,$0219,DEVCHANGE
DIALOG CREATE,Device Change,-1,0,240,269
DIALOG ADD,LIST,LIST1,7,8,224,249
DIALOG SHOW
:evloop
wait event
goto @event()
:DEVCHANGE
LIST ADD,LIST1,@MSGPARAMS(w)
goto evloop
:Close
exit
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Mon Nov 14, 2005 5:27 am Post subject: |
|
|
SS,
Thank you SOOOOO much! That was just what I needed. And it uses no CPU resources until there's a device change.
Then when there's a change I can use other means to find out if the device I'm interested in was the one that changed. _________________ cheers
Dave |
|
| Back to top |
|
 |
|