Detect CD Insert from Windows Service

  • Thread starter Thread starter arcade2084
  • Start date Start date
A

arcade2084

I am trying to detect when a CD is inserted from a windows service. I
have went through the route of creating a hiden window and trying to
use the WndProc to detect the event; although the window does not seem
to be recieving the events that I need. I have also tried registering
the WM_SHNOTIFY event with my specific window and still do not recieve
the event.

Is there another method for recieving the CD insert event from within
a winows service?

Thanks.
 
If you want to get messages sent to the window, then I think you have to
set the checkbox on the service that allows it to interact with the desktop
(since you are trying to get it through a windows message).

You might want to consider an application that runs while the user is
logged in that sends a message to your service when the CD is inserted.
 
I have tried checking that box and the window still does not recieve
the messages; I suspect they may be filtered out by the service.

thanks.

If you want to get messages sent to the window, then I think you have to
set the checkbox on the service that allows it to interact with the desktop
(since you are trying to get it through a windows message).

You might want to consider an application that runs while the user is
logged in that sends a message to your service when the CD is inserted.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)




I am trying to detect when a CD is inserted from a windows service. I
have went through the route of creating a hiden window and trying to
use the WndProc to detect the event; although the window does not seem
to be recieving the events that I need. I have also tried registering
the WM_SHNOTIFY event with my specific window and still do not recieve
the event.
Is there another method for recieving the CD insert event from within
a winows service?
Thanks.- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top