Detecting a desktop switch
-
Does anyone know of a way of detecting when a desktop switch has occurred? I'm not talking about terminal servies (
WM_WTSSESSION_CHANGE
will do that), but a simple single-user desktop switch. There's an API to do the switch (SwitchDesktop()
), but there doesn't seem to be any way of detecting that it has occurred when someone else does the switch. I've used Spy++ to look at every single message sent to my app while I do a switch, and there doesn't seem to be anything unusual, just a bunch ofWM_ACTIVATE
,WM_ACTIVEAPP
,WM_WINDOWPOSCHANGING
(but notWM_WINDOWPOSCHANGED
however) messages. Nothing extraordinary there. The only thing I saw I wasn't expecting was that thecx
andcy
fields in theWINDOWPOS
structure were both set to -1, althoughSWP_NOSIZE
was also set, so they would be ignored anyway.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"