forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Device Notification [Resolved]

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sat Nov 12, 2005 3:22 am    Post subject: Device Notification [Resolved] Reply with quote

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
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Nov 13, 2005 11:54 am    Post subject: Reply with quote

Mac, you're a legend (if I can get it working Wink

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! Sad

_________________
cheers

Dave
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Mon Nov 14, 2005 5:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Mon Nov 14, 2005 5:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group