Sample Windows service to detect device events
To install/uninstall, use InstallUtil.exe utility.
To check device events received,
- Attach the process from Visual Studio (Debug -> Attach to Process -> check
Show processes from all users) or - Open Event Viewer -> Windows log -> Application