You can use WTSRegisterSessionNotification () , you will receive the WM_WTSSESSION_CHANGE message when the user press Ctrl + Alt + Del and switches to the secure desktop.
Remember that you canβt say that it was actually a secure desktop that he switched to, that would be a pretty nasty security leak. You will also receive a notification when it switches to another login session. Also the case when you want, of course, to stop the game.
In this case, the game should automatically pause whenever the game window loses foreground. Nobody likes to be killed when they switch to their mailbox :) Use the WM_ACTIVATEAPP message
source share