I am writing one of my first multithreaded programs.

In one of the thread, I am using WaitForSingleObject method to detect the USER LOG-OFF on a system.

May I know, that is there any way to convert Windows Messages to Handles.

Or is there any other better way to make that particular Thread run when a system event happens like user log-off.

Thanks in advance.