Board index » delphi » Disable [ALT] F4 and [ALT] [TAB]?

Disable [ALT] F4 and [ALT] [TAB]?

I am attempting to develop a Delphi 1.0 application that would require
some manner of password to escape from and which cannot be exited from in
any other manner.  I would like to disable Windows' [ALT] F4 and
[ALT] [TAB] functions.  Can Delphi do this?  Any suggestions would be
greatly appreciated. Thanks!

|---------------------------------------------------------|
| John Tieberg-Bailie | "It is better to have a permanent |
| j...@interaccess.com |  income than to be fascinating."  |
| j...@nslsilus.org    |  - Oscar Wilde                    |
|---------------------------------------------------------|

 

Re:Disable [ALT] F4 and [ALT] [TAB]?


On Fri, 29 Mar 1996 16:17:33, j...@interaccess.com (John

Quote
Tieberg-Bailie) wrote:
>I am attempting to develop a Delphi 1.0 application that would require
>some manner of password to escape from and which cannot be exited from in
>any other manner.  I would like to disable Windows' [ALT] F4 and
>[ALT] [TAB] functions.  Can Delphi do this?  Any suggestions would be
>greatly appreciated. Thanks!

If you install an application-wide CBT hook with "SetWindowsHookEx"
Windows kindly will notify you of a couple of events and ask you
whether to allow / disallow then. Amongst these is

   WM_SYSCOMMAND with its parameters: sc_hotkey and sc_tasklist

That should get you started.

Using this I have taken control over a 16bit system rather completely.

BEWARE: This will NOT work on a 32bit OS (read Win95) - AFAIK (and can
tell) Win95 allows the hook only for the 16bit part...

You would have to install a 32bit hook - but how to do this with a
16bit exe / compiler is something I really would like to know / find
out myself !

If anyone should happen to know how to install a 32bit hook _within_ a
pure 16bit executable / DLL, please, post it to this group or send me
eMail.

HTH and TIA for the 32bit part...
--
Viele Gruesse / Best regards

Stefan
Stefan.Hoffmeis...@Uni-Passau.de

Re:Disable [ALT] F4 and [ALT] [TAB]?


Hi!

Quote
>I am attempting to develop a Delphi 1.0 application that would require
>some manner of password to escape from and which cannot be exited from in
>any other manner.  I would like to disable Windows' [ALT] F4 and
>[ALT] [TAB] functions.  Can Delphi do this?  Any suggestions would be
>greatly appreciated. Thanks!

>|---------------------------------------------------------|
>| John Tieberg-Bailie | "It is better to have a permanent |
>| j...@interaccess.com |  income than to be fascinating."  |
>| j...@nslsilus.org    |  - Oscar Wilde                    |
>|---------------------------------------------------------|

To override it:

1. Put popup menu on a form.
2. Create an item which implements dummy operation (e.g. X:=1 for Delphi
   not remove it).
3. Add a desired shortcut to this item (any combination - see help for details
   smth like VK_...).

--

   K.Kuzenko Galilei Soft.(Kiev,Ukraine).

Re:Disable [ALT] F4 and [ALT] [TAB]?


Quote
Konstantin Kuzenko <K...@galilei.kiev.ua> wrote:
>To override it:

>1. Put popup menu on a form.
>2. Create an item which implements dummy operation (e.g. X:=1 for Delphi
>   not remove it).
>3. Add a desired shortcut to this item (any combination - see help for details
>   smth like VK_...).

Thanks, I've been looking for this one myself.

For some strange reason I was able to close some "palette windows" with
Alt+F4 even without border icons or borders.

Thanks to your tip I added a hidden menu item to a popup menu with Alt+F4
as shortcut, and a messagebeep in the response method. And my palettes
stay on! Cool! :)

It seems that the popup menu has to be assigned to a control thought.
--
Clatu Verata NeckTie                              9ko D'Ch.
                                                  ---------

Other Threads