Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Catch windows messages of ANY app.

Posted on 1998-08-14
6
Medium Priority
?
300 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 210 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

886 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