Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Prevent ALT F4

Prevent ALT F4

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Soren Alsbjerg Horup
    wrote on last edited by
    #1

    Hi, is there anyway to prevent the ALT F4? so my window can't be shutdown like that? If not, is there anyway to "hide" my window from the list of windows which pops op when won presses ALT-TAB. Thanks for any help.

    H 1 Reply Last reply
    0
    • S Soren Alsbjerg Horup

      Hi, is there anyway to prevent the ALT F4? so my window can't be shutdown like that? If not, is there anyway to "hide" my window from the list of windows which pops op when won presses ALT-TAB. Thanks for any help.

      H Offline
      H Offline
      Harsha Gopal
      wrote on last edited by
      #2

      Intercept the WM_CLOSE message and return false. If you are using MFC, goto classwizard and add WM_CLOSE message handler to that particular window and remove the CDialog::OnClose() statement. Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------

      A 1 Reply Last reply
      0
      • H Harsha Gopal

        Intercept the WM_CLOSE message and return false. If you are using MFC, goto classwizard and add WM_CLOSE message handler to that particular window and remove the CDialog::OnClose() statement. Harsha ---------------------------------- http://www.ece.arizona.edu/~hpg ----------------------------------

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        That's right, Make more programs that require a hard reset to get out of. MS finally makes a reasonably stable OS (XP) and then you go and disable essential escape funtionality. Try disabling Alt-Tab and Ctrl-Alt-Del as well (I don't think you will, but would be a good challenge) Alt F4 is there for a reason! Head retracted now (I'm sure you have a legit reason for doing this)!:eek:

        R 1 Reply Last reply
        0
        • A Anonymous

          That's right, Make more programs that require a hard reset to get out of. MS finally makes a reasonably stable OS (XP) and then you go and disable essential escape funtionality. Try disabling Alt-Tab and Ctrl-Alt-Del as well (I don't think you will, but would be a good challenge) Alt F4 is there for a reason! Head retracted now (I'm sure you have a legit reason for doing this)!:eek:

          R Offline
          R Offline
          Ryan Binns
          wrote on last edited by
          #4

          Anonymous wrote: I'm sure you have a legit reason for doing this :) There are plenty of reasons. I wrote a little app a while ago for a church for controlling a LCD projector (turning it on/off etc.). It was an appbar that ran at startup and was permanently set at the top of the screen, and they didn't want people to be able to close it, because then they couldn't control the projector. So I had to do this. I did it in a slightly different way, though. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
          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"

          J 1 Reply Last reply
          0
          • R Ryan Binns

            Anonymous wrote: I'm sure you have a legit reason for doing this :) There are plenty of reasons. I wrote a little app a while ago for a church for controlling a LCD projector (turning it on/off etc.). It was an appbar that ran at startup and was permanently set at the top of the screen, and they didn't want people to be able to close it, because then they couldn't control the projector. So I had to do this. I did it in a slightly different way, though. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
            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"

            J Offline
            J Offline
            Joan M
            wrote on last edited by
            #5

            If you must let people interact with your app, then you should think about setting a system wide keyboard hook in order to avoid all the "strange" keypresses (Ctrl + shift + esc...) and also to implement a gina dll in order to avoid Ctrl+alt+del... you can say then that you control the PC and that you can be sure that people won't touch things that shouldn't... hope this helps.

            R 1 Reply Last reply
            0
            • J Joan M

              If you must let people interact with your app, then you should think about setting a system wide keyboard hook in order to avoid all the "strange" keypresses (Ctrl + shift + esc...) and also to implement a gina dll in order to avoid Ctrl+alt+del... you can say then that you control the PC and that you can be sure that people won't touch things that shouldn't... hope this helps.

              R Offline
              R Offline
              Ryan Binns
              wrote on last edited by
              #6

              Joan Murt wrote: hope this helps. :confused: I never asked a question! :confused: All I had to do was prevent one app from being closed. Task Manager was disabled by system policies, so all I had to do was prevent Alt+F4 and Escape (it was a dialog app). Setting a system-wide keyboard hook would have been massive overkill. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
              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"

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups