How do I process a SERVICE_CONTROL_DEVICEEVENT event?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a Windows service that needs to be aware of the status
removable devices. In essence I want to be able to handle the
SERVICE_CONTROL_DEVICEEVENT event, however I cannot find any way of doing
this using the System.ServiceProcess.ServiceBase class.

Can anyone tell me how to do this? Or is this beyond the capabilities of
ServiceBase and I should revert to Win32?

Thanks.
 
Hi Andy,

I do not think you can do this without a lot of P/Invoke calls to the Win32
API (like RegisterServiceCtrlHandler and RegisterDeviceNotification) so maybe
you are better off reverting to Win32.

Regards, Jakob.
 
Back
Top