Subject: Re: Alt-TAB on ntemacs 19.34/Windows 95

From: "Michael Welsh Duggan" <[email-masked]>
Date: 05 Dec 1996 11:19:14 -0500

Andrew Innes <[email-masked]> writes:

> 
> On Thu, 5 Dec 1996 10:50:08 +0000, David Aspinall <[email-masked]> said:
> >[Sorry in case of a repeat;  I think the previous copy of this got lost]
> >
> >This key raises a window-selection window, which although useful is not
> >what I hoped for.  Can we make this key be caught by Emacs so the 
> >usual completion functions, etc work?
> 
> I don't think so - Alt-TAB and various other keystrokes like it are
> intercepted by the system without ever reaching application programs.
> 
> Under Win95, DOS applications running in a DOS box can be allowed to see
> them, but (as I understand it) that works by using a low-level mechanism
> only applicable to DOS programs running under Win95.

I think there is a way to hack this, but I'm not absolutely sure it
would work...

You should be able to use RegisterHotKey() to declare the Alt-Tab
combination a hot key.  Then when the combination is pressed, a
WM_HOTKEY message is sent.  The problem is that this message is pushed
to the top of the event queue.  Because of this, I anticipate
key-ordering problems, even if we translate the command and repost it
as a char event.  However, someone more knowledgable about the Emacs
internals may know a way this can be hacked.

The keys that may need to be trapped this way are:

Alt+Esc
Alt+PrintScreen
Alt+Tab
Ctrl+Esc
PrintScreen
Shift+Alt+Tab

I am not sure at all about Ctrl+Alt+Del.  :-) 

-- 
Michael Duggan
([email-masked])