Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Ctrl + Alt + Del => window closes

This thread is locked; no one can reply to it. rss feed Print
Ctrl + Alt + Del => window closes
Gideon Weems
Member #3,925
October 2003

Why again do we want this behavior? Hehe, please enlighten me.

(Previous discussion)

orz
Member #565
August 2000

It's control-alt-end.

I personally am fond of it, and have gone so far as to build that into some of my SDL programs too. It quits a program instantly, without fuss, even if it's stuck in an infinite loop or somesuch. And on the rare freezes where even that doesn't work, the fact that it doesn't work tells you something about the nature of the crash.

Gideon Weems
Member #3,925
October 2003

Oh, I'm fond of Ctrl + Alt + End also. I'm talking about Alegro 4.20 and WinXP Pro. A windowed app is run, and I press Ctrl + Alt + Del. The "Window Security" dialog pops up, and the Allegro app unexpectedly closes. If the app is run from the commandline, I get this:

Quote:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Running under gdb yields exit code 03.

orz
Member #565
August 2000

Blurp!

I was not aware of that. Dunno why it would be. Excessive worship at the altar of DOS?

Kitty Cat
Member #2,815
October 2002
avatar

ctrl+alt+del is a throw back from the old DOS days. When you had a program running and it locked up form a bug, you couldn't press ctrl+c to kill it. And because DOS wasn't multitasking, you couldn't switch away from the program and kill it. All you could do was press ctrl+alt+del to reboot the computer. That's not very nice when testing though, so ctrl+alt+del was hijacked and made to close the program via SIGINT. When Windows came along, it took over ctrl+alt+del even from a DOS program, thus ctrl+alt+end was added.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Gideon Weems
Member #3,925
October 2003

I understand the story behind it. The fact remains, though: This shouldn't happen on a multi-tasking OS. So. Can we change it? Where in Allegro would one look?

Matthew Leverton
Supreme Loser
January 1999
avatar

To summarize the discussion for those that have not seen the previous posts: this thread is not about CTRL-ALT-END.

Under Windows, CTRL-ALT-DEL closes an Allegro application if it has focus. Allegro should always ignore CTRL-ALT-DELETE, letting Windows run the Task Manager. The three_finger_flag should do nothing with CTRL-ALT-DELETE.

I just checked wkeybd.c and saw that Allegro only is checking for CTRL-ALT-END (either the literal END key, or number 1 on the number pad). So, I logged the output, and I got this when I pressed CTRL-ALT-DEL:

CTRL-ALT-d3   *** DELETE
CTRL-ALT-0
CTRL-ALT-2
CTRL-ALT-3
CTRL-ALT-4
CTRL-ALT-5
CTRL-ALT-6
CTRL-ALT-7
... snip ...
CTRL-ALT-4e
CTRL-ALT-4f   *** NUMPAD1  <-- allegro exits

So it seems that Windows fires off CTRL-ALT-EVERYTHING once CTRL-ALT-DEL is pressed. Allegro eventually gets the END sequence and dies. I'm assuming that Windows is responsible for generating all those messages.

I could easily put a hack together to stop it from happening, but perhaps someone knows the proper way?

Evert
Member #794
November 2000
avatar

It might be interesting to find out if older versions of Allegro (aka, 4.0.3) show the same behavior and if it is consistent on all versions of Windows or just on XP (say).

Gideon Weems
Member #3,925
October 2003

Going on what Matthew said, this would be present in every Allegro version that uses the three finger salute (Ctrl + Alt + End). The problem, though, is Windows. I'll try reproducing the behavior on '98...

Also, as mentioned in the old discussion I linked, the behavior might be related to fast user switching--but, like Matthew said, it's Window's problem not Allegro's. I'll also try reproducing the behavior after toggling fast switching.

-- edit --

I couldn't reproduce the behavior on Win98, All4.20. On WinXP, fast user switching doesn't seem to make a difference, either.

Evert
Member #794
November 2000
avatar

Quote:

Going on what Matthew said, this would be present in every Allegro version that uses the three finger salute (Ctrl + Alt + End).

Allegro 4.2 uses a different keyboard driver than 4.0 did. I was thinking the behavior might somehow be related.

Quote:

I couldn't reproduce the behavior on Win98, All4.20. On WinXP, fast user switching doesn't seem to make a difference, either.

Hmm... so in other words, it's a Windows XP feature?

gnolam
Member #2,030
March 2002
avatar

Allegro does what now? That doesn't happen with any of my programs...

[UPDATE]
Tested it fullscreen and windowed, regular Allegro and AllegroGL. They still stay open.

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Gideon Weems
Member #3,925
October 2003

Quote:

Hmm... so in other words, it's a Windows XP feature?

That seems to be the case. Only, I just ran an old binary of mine statically linked with a version < 4.2 (probably 4.03), and it was not affected by Ctrl+Alt+Del. I'm not sure how to interpret that, but you might be right about the new driver.

On the other hand, this problem has been documented as far back as February of 2003...

Evert
Member #794
November 2000
avatar

Quote:

On the other hand, this problem has been documented as far back as February of 2003...

Eh?
Can you provide a link? This is the first time I recall hearing about it.

Gideon Weems
Member #3,925
October 2003

Matthew Leverton
Supreme Loser
January 1999
avatar

Quote:

Hmm... so in other words, it's a Windows XP feature?

I would say it is a feature of (I guess) Windows 2000/XP that Allegro should be aware of. I don't know what the purpose is.

Attached is a patch to ignore CTRL-ALT-END sequences that are generated by CTRL-ALT-DEL. Only if three_finger_flag is TRUE, then CTRL-ALT-END will abort() the application. Regardless of its setting, CTRL-ALT-DEL will bring up the Task Manager.

To test, use: http://www.matthewleverton.com/misc/exkeys.exe

I tested under Windows XP and Windows 98 (under a VM) and there doesn't seem to be any side effects.

Quote:

Can you provide a link? This is the first time I recall hearing about it.

See his link at the top of the thread. I'm assuming it's always been a problem under Windows XP, but not under Windows 98 due to different things happening when CTRL-ALT-DEL is pressed.

It is very annoying to be testing or using an Allegro application, only to have it exit after you hit CTRL-ALT-DEL to check its resource usage.

Evert
Member #794
November 2000
avatar

Quote:

I would say it is a feature of (I guess) Windows 2000/XP that Allegro should be aware of.

Of course.

Quote:

See his link at the top of the thread.

That's what you get for following a thread through e-mail and jumping in on the forum half way during the thread. Missed it completely.
Seems I did also read the thread back then, but apparently the problem was then assumed to be the `normal' behavior.

Quote:

I'm assuming it's always been a problem under Windows XP, but not under Windows 98

Looks to be, yes.

Quote:

It is very annoying to be testing or using an Allegro application, only to have it exit after you hit CTRL-ALT-DEL to check its resource usage.

Sure, I wasn't about to suggest ignoring the problem.

In private I still think it's stupid that Windows now uses ctrl-alt-del for something other than an emergency shutdown of the system.

BAF
Member #2,981
December 2002
avatar

Well NT, 2K, and XP don't handle C+A+D as an emergency. You use that key combo to log in, lock the computer, log out, etc. Or with fast user switching, you use it to bring up the task manager. On windows 9x C+A+D totally locked out the system with the task manager, 2k/XPs is more friendly as it runs alongside everything.

Felipe Maia
Member #6,190
September 2005
avatar

It didn't happen to me while in allegro 4.0.3 on Windows XP (checking memory usage), I don't have a 4.2 build, so I won't try it to see.

Go to: