Solved

Delphi Programming question

Posted on 1997-08-29
1
157 Views
Last Modified: 2010-04-06
I would like could capture the  keys CTRL-ESC and CTRL-ALT-SUPR in Win95 from my Delphi program in order to avoid that the user could close applications or throw another without my consent, but I don't find the manner of making it. I have looked at the API and I believe that I should capture the WM_HOTKEY message but I have not been successful.

I would thank if somebody could help me or guide me in it.

Thanks to all.

Kirk.
0
Comment
Question by:kirk9
1 Comment
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1342981
This is from Lloyd's help file. Didn't check it.

Q. How do I override the default message handler for my Application?

A. You create a dynamic method that is indexed to the message constant
   that you want to override.  If you want to override the CM_DIALOGKEY
   message you would declare the following procedure in the public
   section of you class declaration:

   Procedure CMDialogKey(var Message: TCMDialogKey);message CM_DIALOGKEY;

   It is common practice to declare the procedure name the same as the
   message name minus the underscore.  Your message handler would look
   something like this:

   Procedure TForm1.CMDialogKey(var Message: TCMDialogKey);
   begin
     if CharCode = VK_TAB then begin
       {Process the Alt+Tab key here}
       result := 1;

       exit;
     end;
     inherited;
   end;

   Setting result to 1 stops further processing. The inherited
   statement passes control to the parent handler. Be sure to
   execute inherited for all the cases you don't want to handle.
   Do not execute it for the ones you do handle.

{ This code came from Lloyd's help file! }
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 119
Controlled Assessment GCSE - desperate help needed 4 101
Dynamically Created Query 3 62
Dev express lookupcombo 3 34
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question