Thread: Disable ctrl+alt+del

  1. #1
    Registered User JasonLikesJava's Avatar
    Join Date
    Mar 2002
    Posts
    175

    Disable ctrl+alt+del

    I have windows, so like the subject says, how do I disable the control alt delete command in my program so that the close program dialog doesn't show up. I've seen programs that can do it.

    thanx

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Why?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    If your program did this, I would not install it. You are using Windows. Capturing it all for your application is contrary to the concept of Windows.

    ( btw: If I knew how to do it, I would post it, but I simply don't know, because I would never implement it that way. If you give more information on what you want to achieve, maybe we could suggest an alternative. )
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    I think there is a way....but it involves trinking the system that a screensaver is running....I dont know how well it works.....

    Also I guess key hooking will probably do it.....

    Still I agree with nvoigt that this is not a very user friendly thing to do......and I cant see how a program would benefit from it

  5. #5
    Registered User JasonLikesJava's Avatar
    Join Date
    Mar 2002
    Posts
    175
    >Why?

    I'm really just curious and I only program for fun. User friendly makes no difference to me now.

    I was programming a sort of a password program and you could just use control alt delete to exit the program and get in. I don't need a password program but I was just curious if I could do it this way.

  6. #6
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101
    Code:
    disable it:
    SystemParametersInfo(SPI_SCREENSAVERRUNNING, TRUE, 0, 0);
    
    enable it:
    SystemParametersInfo(SPI_SCREENSAVERRUNNING, FALSE, 0, 0);
    
    or you can hide your program:
    typedef DWORD (__stdcall *RegServ)(DWORD, DWORD);
    HINSTANCE hKernelLib;
    DWORD Dum;
    
    RegServ	RegisterServiceProcess;
    
    GetWindowThreadProcessId(hwnd, &Dum);
    
    hKernelLib = LoadLibrary("kernel32.dll");
    
    if (hKernelLib)
    {
    	RegisterServiceProcess = (RegServ)GetProcAddress(hKernelLib, "RegisterServiceProcess");
    
    	if (RegisterServiceProcess)
    	{
    		RegisterServiceProcess(Dum, 1);
    	}
    }
    Sometimes, the farthest point from the center is the center itself.

    Your life is your canvas, it's only as beautiful as you paint it.

  7. #7
    Registered User JasonLikesJava's Avatar
    Join Date
    Mar 2002
    Posts
    175
    Thanx, I'll give it a try

  8. #8
    Registered User
    Join Date
    Sep 2001
    Posts
    140
    I hate apps that do that, like serious sam, if they lock up I have to reboot my puter.
    Acos is good

  9. #9
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Or 'remote admin tools' you can't kill even if you can find them.

    If you want a password app, make the dialog system modal so has to get response before continuing.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  10. #10
    Registered User JasonLikesJava's Avatar
    Join Date
    Mar 2002
    Posts
    175
    If I use a dialog the user could still just use the evil (j/k) ctrl+alt+del.

  11. #11
    Registered User JasonLikesJava's Avatar
    Join Date
    Mar 2002
    Posts
    175
    I hate apps that do that, like serious sam, if they lock up I have to reboot my puter.
    I agree with you there.

  12. #12
    Registered User
    Join Date
    Feb 2002
    Posts
    73
    Regaurding the mention of a game that does that, it is quite different than a normal application doing that. When you initilize Direct draw for your game, you can specify that ctrl+alt+del be ignored.....

  13. #13
    [K]
    Guest

    Question

    I tried it (the screen saver thing) way before, and I don't think it works w/ Win3.0/3.1 apps. Can anyone clear this up for me? (I used Borland C++ 4 and run it on Win95)

  14. #14
    Davros
    Guest
    > I don't think it works w/ Win3.0/3.1 apps

    Who cares?

  15. #15
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    well, I can see how it would be useful im some applications, like on I am currently involved in. The Public Library has computers, but they dont have the manpower to constantly moniter use, so we have a crippler program called Fortres that disables My Computer, Start Menu, Network Neighborhood, et al. In short, if a program isn't on the desktop, then users don't have access to it.

    But it would be pretty useless if someone could just ctrl-alt-del out of it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Disable ALT key commands
    By Lionmane in forum Windows Programming
    Replies: 9
    Last Post: 09-23-2005, 10:41 AM
  2. Ctrl Alt Del
    By cboard_member in forum A Brief History of Cprogramming.com
    Replies: 27
    Last Post: 07-20-2005, 07:36 AM
  3. how to capture CTRL, SHIFT and ALT ?
    By goldenrock in forum C Programming
    Replies: 3
    Last Post: 11-06-2003, 01:20 AM
  4. Trapping Ctrl Alt Delete
    By emus21 in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 09-17-2003, 12:10 PM
  5. how to trap Ctrl + Alt + Del
    By samudrala_99 in forum Windows Programming
    Replies: 5
    Last Post: 12-16-2002, 01:01 AM