Solved

Catch windows messages of ANY app.

Posted on 1998-08-14
6
289 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
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.

 
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

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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