Getting wndproc in console

Hi,
Hope you can help me on this.
Is there a way I can monitor the insertion and removing of usb flash drive using console application? If this is possible, can you give me some hint on how to do it? A simple console application perhaps?

I tried to search it in the net but it did not actually give what I really need.

thanks
gilmar
Have no time for code, but yes, you should be able to create a top-level window in a new thread. The new thread creates the window and enters a message loop. Pick up the WM_DEVICECHANGE message and process it in the window procedure. If you need to communicate with the main thread, then set up a communication mechanism, like an event or semaphore.
Obnoxious, isn't it?

That's because the Windows Console doesn't have a Window Proc! That's why you have to create another, hidden toplevel window to do all that stuff for you.

Good luck!
Topic archived. No new replies allowed.