Solved

Delphi Programming question

Posted on 1997-08-29
1
149 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now