CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    53

    Disabling/capturing windows shortcut keys

    Hey there

    I have a Windows applications written in C++ using Win32 API's.

    The problem am facing now is, if the user presses the Alt + F4 key the application will close.

    Is there a way of disabling that via the app itself?

    Like capturing the windows shortcut key and then do nothing?

    Same about Ctl + Alt + Del.

    Is it possible to disable that?

    How can i capture these key presses in my app?

    Thanks in advance.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Disabling/capturing windows shortcut keys

    Quote Originally Posted by Don Guy View Post
    Hey there

    I have a Windows applications written in C++ using Win32 API's.

    The problem am facing now is, if the user presses the Alt + F4 key the application will close.

    Is there a way of disabling that via the app itself?
    Yes. You have to handle WM_SYSCOMMAND message with SC_CLOSE parameter.
    Victor Nijegorodov

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Disabling/capturing windows shortcut keys

    Same about Ctl + Alt + Del.
    Nope. AFAIK, windows itself is the only one that is allowed to capture CtrlAltDel (for security reasons).

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Disabling/capturing windows shortcut keys

    Why would you want to do that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured