Sign in to follow this  
Followers 0
mary

detect when user introduce a pen drive

5 posts in this topic

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



DriveGetDrive in the help file


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

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

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  
Followers 0