I used the below link http://www.muukka.net/programming/service/Beeper%20Service.cpp to write a service. but the problem here is, the servicemain function gets called only when service stop is requested.
I want to start the servicemain function before hand, to detect usb devices connected.. what should I do for that..
In code:
change to:
Also try this:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb540476%28v=vs.85%29.aspx