Solved

Catch windows messages of ANY app.

Posted on 1998-08-14
6
292 Views
Last Modified: 2010-04-04

How can i catch windows messages of ANY application? For example, how can i cath the message WM_QUIT
sent from an application to Windows or vice versa.
0
Comment
Question by:migue77
6 Comments
 

Author Comment

by:migue77
ID: 1362102
Edited text of question
0
 
LVL 4

Accepted Solution

by:
BoRiS earned 70 total points
ID: 1362103
migue77

You will have to use the SetWindowsHookEx API call and hook into a sytem wide DLL, as far as I can see...this seems to be the onl way to trap full system messages like WM_QUIT etc...

Later
BoRiS
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1362104
You can also override the WndProc....and then you can trap the message there..

//Viktor Ivanov
0
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!

 
LVL 10

Expert Comment

by:viktornet
ID: 1362105
You can also override the WndProc....and then you can trap the message there..

//Viktor Ivanov
0
 

Expert Comment

by:ms99y
ID: 1362106


If you have a specific message to catch than you can write a procedure to the form of your app like the following;
    form class declaration begins here...


   public:
    procedure MyHandler(var Msg: TMsg);message WM_QUIT;
   
or as Victor said you can override the WndProc to catch all the messages to your app.
But when overriding the WndProc be careful. Because all messages goes through this WndProc so be careful in regard of your application performance. Handle the message of your interest and call the inherited WndProc for the other messages.

ms99y
later



0
 

Author Comment

by:migue77
ID: 1362107
You answer that question... so there are your points
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Multiple image collision 13 87
DBGrid or StringGrid ? 6 119
Delphi problems to abort a printjob 9 34
How to insert .png images to TClientDataSet .cds file? 2 68
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…

685 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