Solved

Delphi Programming question

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

17 Experts available now in Live!

Get 1:1 Help Now