How to prevent autoplay and run my own app when inserting an USB-Flash drive
- by Thomas
when inserting an USB-Flash drive, Windows normally opens the Autoplay dialog that offers to browse the drive or if there are multimedia files it offers to choose an app to open them.
We developed a media player that is connected to the USB-Drive and registers itself as Mass Storage Device.
What I need is, that when inserting the Player that this Dialog is not shown, but instead my own application is launched.
Ideally the application would be on the Flash Drive itself, but as I understood is that Autorun is disabled for USB-Drives.
It would be enough if a preinstalled application is launched. I already tried to catch the WM_DRIVE_CHANGE message, but this only works if my application is the top most window, otherwise the Autoplay Dialog is displayed.
Best
Tom