device notification
-
Hi, In my app, I want to be notified for device changes. I tried to register for notification using RegisterDeviceNotification() function. But this function takes window handle as its first param. But my app is console app. How do I have to do this. I also wanted to receive WM_Device messages. Can I create a handle to WinMain and use RegisterDeviceNotification() and have a callback window procedure using this handle?? How to do that. How to create a handle to winmain?? If not can I create an invisible window and handle the messages. How do I create an invisible window?? Thanks a lot in advance.
-
Hi, In my app, I want to be notified for device changes. I tried to register for notification using RegisterDeviceNotification() function. But this function takes window handle as its first param. But my app is console app. How do I have to do this. I also wanted to receive WM_Device messages. Can I create a handle to WinMain and use RegisterDeviceNotification() and have a callback window procedure using this handle?? How to do that. How to create a handle to winmain?? If not can I create an invisible window and handle the messages. How do I create an invisible window?? Thanks a lot in advance.
Manu_81 wrote:
I tried to register for notification using RegisterDeviceNotification() function. But this function takes window handle as its first param. But my app is console app.
Which does not mean that your application cannot create a hidden window for the sole purpose of receiving notifications. This is not an uncommon form of communication between processes.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain