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

x
?
Solved

Is there a class in Framework which u can use to capture all Windows events?

Posted on 2004-09-01
2
Medium Priority
?
172 Views
Last Modified: 2008-03-06
Is there a class in Framework which u can use to capture all Windows events?
0
Comment
Question by:MargusLehiste
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
imu79 earned 500 total points
ID: 11958110
Most events in windows are in the form of messages. you can use the IMessageFilter interface to capture all messages. Here's an example of how you can use the IMessageFilter interface:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassaddmessagefiltertopic.asp

note that the method IMessageFilter.PreFilterMessage filters the messages as soon as they leave the message queue and before they are sent to the destination control.

hope this helps..
Imran.
0
 
LVL 3

Expert Comment

by:imu79
ID: 11958161
You can also use the NativeWindow class to process all messages. here's an article that will get you going on how to use this class to process window messages:

http://www.vbaccelerator.com/home/NET/Code/Libraries/Windows_Messages/Subclassing_in__NET/article.asp

The difference here is that in this the messages are intercepted only after they've been dispatched to the appropriate window.


Also take a look at this article which I think might help:

http://www.sys-con.com/dotnet/article.cfm?id=482


hope this helps..
Imran.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Screencast - Getting to Know the Pipeline

824 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