From: "Jialiang Ge [MSFT]" on

Hello Timothy

If you were on Windows 7, you can actually try the new trigger start
feature. For example, your service is started only when a USB *storage*
device is inserted. You can find the sample code here:
http://support.microsoft.com/kb/975425/en-us

Regarding 0x42A set by RegisterDeviceNotification, could you please do this
test to confirm that 0x42A was not set by other functions?

SetLastError(0);
hDevNotify = RegisterDeviceNotification(hMainWnd, &NotificationFilter,
DEVICE_NOTIFY_WINDOW_HANDLE);
if (hDevNotify == NULL)
{
printf("%d\n", GetLastError());
}


Regards,
Jialiang Ge
Microsoft Online Community Support

=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================