How to get a C++ Windows service to be properly notified when user log on/off or PC enters sleep/hibernation -
i have c++ windows service starts tcp server when booted. problem when user logs on/off service no longer responses client requests, when returns hibernation. need notified power modes suspend/resume server proper way.
i tried servicebase.onpowerevent()
visual studio says undefined. method available c#? there counterpart in c++?
it worth mentioned service template used have downloaded online tutorial, not default template comes vs.
servicebase.onpowerevent .net services based on servicebase. wrapper of service_control_powerevent.services notified of log on , log off events via service_control_sessionchange.
for list of notification code, check handlerex callback function
Comments
Post a Comment