akashnemani 0 Newbie Poster

Hi,

I am trying to create a service for my windows application. The service would just call an application if it detects a USB device inserted on the computer.

I want to register for device change notification to receive all the usb device event messages. In order to register for the devicechange I need to call the
"HDEVNOTIFY RegisterDeviceNotification"

HDEVNOTIFY WINAPI RegisterDeviceNotification(
__in HANDLE hRecipient,
__in LPVOID NotificationFilter,
__in DWORD Flags
);

function which takes in the service handle as one of its parameter. But using the Windows Service project in Visual Studio 2008, I cannot find anyway to get the handle. Can you please help.

Thanks,


Regards,
Akash Nemani