I have a VB.NET application that communicates with some kind of external server (supports login sessions via Intranet) and I want to listen to Sleep / Hibernate events, so when that happens I want to log out of the existing session system before as the computer goes to sleep while my application runs in the background, but does nothing.
Conversely, when a computer resumes with Hibernate or Woke up from sleep, I want to immediately log into the server.
How can I capture these events and execute my code? I believe this applies to the Win32 API, which I should use in VB.
Thanks.
Kushal
source share