Solved

Catch windows messages of ANY app.

Posted on 1998-08-14
6
294 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
[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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

623 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