Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

Trigger/Event when a usb thumb drive is inserted? (vista)


Is there a way to catch an event/trigger that *might* be fired when a
usb thumb drive is inserted into a Vista PC?

The reason I ask is that I'd like to catch that event and back up the
content of the thumb drive to the local machine with a custom process.

I realize there might be some security issues with this...but it would
sure be useful if I could do it.

-Thx

<kilik3@gmail.com> wrote in message

news:1181086323.887875.316220@n4g2000hsb.googlegroups.com...

> Is there a way to catch an event/trigger that *might* be fired when a
> usb thumb drive is inserted into a Vista PC?

> The reason I ask is that I'd like to catch that event and back up the
> content of the thumb drive to the local machine with a custom process.

> I realize there might be some security issues with this...but it would
> sure be useful if I could do it.

Look into Autoplay. When the USB drive or CD or other media is inserted a
list of apps appears. You can get your app added to this list and the user
can decide whether to have your app run always or have it as an option. The
WIA sdk that can be downloaded from MS will allow you to easily add your app
to this list.

"Michael C" <nos@nospam.com> wrote in message

news:eunQDu9pHHA.1220@TK2MSFTNGP03.phx.gbl...

Good if you want to run an app for a particular thumb drive being inserted.

If you want to detect *any* removable USB drive, override WndProc and listen
for WM_DEVICECHANGE.  You get a DEV_BROADCAST_VOLUME structure which tells
you the drive letter.

http://msdn2.microsoft.com/en-us/library/aa363480.aspx
http://msdn2.microsoft.com/en-us/library/aa363249.aspx

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc