Solved

Delphi Programming question

Posted on 1997-08-29
1
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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