473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

IMessageFilter not for controls or form

IMessageFilter interface allows one to capture messages before they are
sent to a control or a form. Is there a way, perhaps by implementing
another interface, to capture all messages to an exe.

In other words, if I add a custom message filter implementing the
IMessageFilter interface to my notifyicon class, I can capture messages
when I display forms. If I add custom event handlers to the various
events in the SystemEvents class I can respond to system wide events
like session ending. I would like to be able to respond to any event my
exe might be sent, or "Filter" any message sent to it.

Thanks!
Jul 25 '07 #1
2 3767
I don't quite understand what you are trying to do, since the
IMessageFilter interface implementation will be called for EVERY windows
message that is passing through the app. There is no way to specify to get
messages for one specific control or another. It is a catch-all.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"deciacco" <a@awrote in message
news:Vv******************************@giganews.com ...
IMessageFilter interface allows one to capture messages before they are
sent to a control or a form. Is there a way, perhaps by implementing
another interface, to capture all messages to an exe.

In other words, if I add a custom message filter implementing the
IMessageFilter interface to my notifyicon class, I can capture messages
when I display forms. If I add custom event handlers to the various events
in the SystemEvents class I can respond to system wide events like session
ending. I would like to be able to respond to any event my exe might be
sent, or "Filter" any message sent to it.

Thanks!

Jul 25 '07 #2
I want to be able to catch any message sent to my notifyicon app.
In the tests that I did, it looked like the only times I would be able to catch messages was when a window was open. For example my notifyicon app has
a settings window that can be pulled up by clicking on settings in the context menu. If that window was up then I would get messages, but if the
window was hidden, then no messages.

Nicholas Paldino [.NET/C# MVP] wrote:
I don't quite understand what you are trying to do, since the
IMessageFilter interface implementation will be called for EVERY windows
message that is passing through the app. There is no way to specify to get
messages for one specific control or another. It is a catch-all.

Jul 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: See Sharp | last post by:
Hello all, I have a form class that implements the imessagefilter interface public class frmMain : System.Windows.Forms.Form, IMessageFilter I also have this implemented bool...
7
by: Michael Culley | last post by:
I've added an IMessageFilter to my app but I don't get messages or I get only a few and then it stops. My code is very simple. Am I doing something wrong? public class MF : IMessageFilter {...
1
by: Neil Stevens | last post by:
Hi, I am in the process of developing a popup utility for a project i am working on, the basic idea is that when a user presses the control key a popup menu will be displayed listing the shortcut...
4
by: GrandpaB | last post by:
Hi, I recently had a post about how to block Mousewheel events. The answer was to implement an IMessageFilter. Sadly, I must report that after 24 hours of researching my library and online...
4
by: ThunderMusic | last post by:
Hi, I'm developping a form that renders differently when hovered and trigger some processing when not hovered (leaved). The thing is, when I leave my form and another form from my application is...
0
by: ah.ping.luk | last post by:
Dear All, i want to catch the application event (WM_CLOSE) in a user control. i create a class that implement the IMessageFIlter interface as follow: ...
2
by: bakpao | last post by:
I want to have a form that accepts keypresses. The controls other than the form should not receive any of the user input. I have implemented it using IMessageFilter but now just now I discovered...
4
by: =?Utf-8?B?am9obmY=?= | last post by:
Trying to get a see windows messages using IMessageFilter interface however it does not seem to get all window messages. Specifically I am looking for the WM_POWERBROADCAST. I override wndproc...
4
by: Ashish Gupra | last post by:
Hi, I want to use 'IMessageFilter' interface to monitor my Key and mouse events to let me know the idle time of my application. But this interface nt works fine. 'PreFilterMessage' function of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.