Jump to content

detect when user introduce a pen drive


mary
 Share

Recommended Posts

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
Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...