Catching Ctrl + Alt + Delete

0

I have a Windows UI that I've designed in wxPython. I recently had a user report a rather unusual behavior to me -- when he'd unlock his PC he would be presented with a dialog asking him to confirm the removal of one of his Print Queues. Digging deeper, it actually turns out the dialog is generated when my user presses Ctrl + Alt + Delete to lock his workstation.

Is that key combination supposed to be forwarded to client applications? Is it reasonable to special case my key-handler function to ignore the Delete key if the Ctrl + Alt modifiers are both present when the users presses Delete, or should I be considering contacting Microsoft about a potential bug?

g.d.d.c

Posted 2014-04-11T17:12:29.933

Reputation: 103

You shoud ask this on stackoverflow – NoNameProvided – 2014-04-11T17:25:44.253

@NoNameProvided - I considered asking there, but wasn't sure if it was specific to my program, or something more Windows generic that I should be concerned with beyond the scope of a particular code snippet. I have no errors to troubleshoot or fix, I was more interested in whether the key combination should ever reach a client app. – g.d.d.c – 2014-04-11T17:27:41.530

Have you run the usual anti-malware stuff? HijackThis? MalwareBytes? Normally, I believe you are correct, windows should interrupt this combination... Another thing to check is whether the keyboard has been re-mapped somehow. – Madball73 – 2014-04-11T17:28:20.400

@Madball73 - No keyboard remappings that I'm aware of, I'm able to reproduce the behavior. A List Control in my application receives an event for the Delete key while Ctrl + Alt are held. – g.d.d.c – 2014-04-11T17:29:52.847

Re-reading your case, it seems that Windows is intercepting it, and taking precedence, but still allowing other applications to react handle in the background. So, probably Working As Designed from MS perspective. – Madball73 – 2014-04-11T17:53:44.397

Answers

1

Ctrl+Alt+Del is considered the "Secure Attention Sequence", it is always guaranteed to be first processed by windows itself (to do things like display the logoff screen or the task manager) then it may be potentially processed by any programs that are listening.

Yes, you should check what modifier keys are pressed when you receive a Delete key command, no it is not a bug otherwise programs that do need to listen for Ctrl+Alt+Del1 would not be able to listen for it.

1: For example VMWare Player will give you a popup dialog telling you that you need to use Ctrl+Alt+Ins to send the SAS command to the VM instead of Ctrl+Alt+Del when you return from the SAS screen.

Scott Chamberlain

Posted 2014-04-11T17:12:29.933

Reputation: 28 923

Thanks, that's what I was curious about. I'll write in the necessary checks to avoid the undesirable behavior for my users. Much appreciated! – g.d.d.c – 2014-04-14T16:55:31.537