Jump to content
Sign in to follow this  
mary

detect when user introduce a pen drive

Recommended Posts

mary

hi !

is there a way to detect this event :(i.e: pen drive introducing) ? both win 2000 and xp

thiks

Share this post


Link to post
Share on other sites
Somerset

DriveGetDrive in the help file


 

Spoiler

 

Share this post


Link to post
Share on other sites
BrettF

hi !

is there a way to detect this event :(i.e: pen drive introducing) ? both win 2000 and xp

thiks

Maybe:

$var = DriveGetDrive("REMOVABLE")

While 1
    Select
        Case Not $var[0] = DriveGetDrive("REMOVABLE")
            MsgBox(0, "Drive", "A removeable drive was inserted.")
        Case Else
            
    EndSelect
WEnd

Edit: Woah! What im i on... Edited code. UNTESTED!!

Edited by bert

Share this post


Link to post
Share on other sites
mary

thinks ! i'll try this function.

maybe there is other way (registry event, process lanch, or other plugins events)

Share this post


Link to post
Share on other sites
Helge

I played a bit with GUIRegisterMsg and some message I can't remember the name of at the moment...maybe WM_DEVICECHANGE.

It worked for me, but I'm pretty certain it also fires on other events as well, so try googling it a bit and I'm sure you'll find something

interesting concerning pen-drives.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×