Posted by: Christian Wimmer in: Common
The WinSta0_DesktopSwitch Event allows an application to check for a desktop switch. The following examples demonstrates how we can wait for such an Event. To test it, simply lock and unlock the workstation. Both wait function will return on the two desktop switching.
var H : THandle;
H := OpenEvent(SYNCHRONIZE, false, ‘WinSta0_DesktopSwitch’);
if H = 0 then
You should know that each session (0…x) has its own event. You can’t use this mechanism directly in a service (especially not in Vista due to session isolation).