473,768 Members | 6,794 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Messages

Hey all,
I'm looking for a way to view all of the windows messages, like Spy ++
does. It's fairly trivial to do it for the current application, but how can
I take that knowledge to the bigger (system-wide) picture?

Thanks,
~D
Nov 20 '05 #1
7 2381
Hi,

Maybe this will help.
http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------------
"Dracolytch " <No****@nowhere .net> wrote in message
news:Y6******** **********@nwrd dc02.gnilink.ne t...
Hey all,
I'm looking for a way to view all of the windows messages, like Spy ++
does. It's fairly trivial to do it for the current application, but how can I take that knowledge to the bigger (system-wide) picture?

Thanks,
~D

Nov 20 '05 #2
Hi,

Thanks for posting in the community.

First of all, I would like to confirm my understanding of your issue.

From your description, I understand that you wants to know how to monitor
all the windows messages in System Wide From VB.NET something like Spy++?
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may need to use the Hook technique to set an system-level
Global Hook to WH_GETMESSAGE.

But Global Hook is Not Supported in .NET Framework

You cannot implement global hooks in Microsoft .NET Framework. To install a
global hook, a hook must have a native DLL export to insert itself in
another process that requires a valid, consistent function to call into.
This requires a DLL export, which .NET Framework does not support. Managed
code has no concept of a consistent value for a function pointer, because
these function pointers are proxies that are built dynamically.

319524 HOW TO: Set a Windows Hook in Visual Basic .NET
http://support.microsoft.com/?id=319524
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #3
* "Dracolytch " <No****@nowhere .net> scripsit:
I'm looking for a way to view all of the windows messages, like Spy ++
does. It's fairly trivial to do it for the current application, but how can
I take that knowledge to the bigger (system-wide) picture?


You will have to set up a global message hook ('WH_GETMESSAGE '). Maybe
you can base your sample on this example program written by Paul Kimmel:

<http://www.developer.c om/net/net/article.php/11087_2193301_1 >

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Herfried,

this is a really good article, however I have a question for you. Now, the
way I understand Global Hooks is that its not possible in .NET because it
cannot be exported like a regular DLL into other processes. (I knew this
before Peter made his statement).

I have recently been trying to do global hooks in .NET with mouse events,
now, looking at this article, I wonder, is the same possible or am I
misreading this article as a global hook solution?

Thanks,
CJ
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:c0******** *****@ID-208219.news.uni-berlin.de...
* "Dracolytch " <No****@nowhere .net> scripsit:
I'm looking for a way to view all of the windows messages, like Spy ++
does. It's fairly trivial to do it for the current application, but how can I take that knowledge to the bigger (system-wide) picture?


You will have to set up a global message hook ('WH_GETMESSAGE '). Maybe
you can base your sample on this example program written by Paul Kimmel:

<http://www.developer.c om/net/net/article.php/11087_2193301_1 >

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
Actually, if you have some global hook c++ code for the mouse that would be
awesome... I'm sure I could find some online but hell, why bother.

my email is
cege at839-0- tavayn 3830dot 3422com342

remove numbers and dashes.

"Tom Shelton" <to*@mtogden.co m> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
In article <10************ *@corp.supernew s.com>, CJ Taylor wrote:
Herfried,

this is a really good article, however I have a question for you. Now, the way I understand Global Hooks is that its not possible in .NET because it cannot be exported like a regular DLL into other processes. (I knew this before Peter made his statement).

I have recently been trying to do global hooks in .NET with mouse events, now, looking at this article, I wonder, is the same possible or am I
misreading this article as a global hook solution?

Thanks,
CJ


Low level hooks are possible in .NET - but you should be aware that
WH_KEYBOARD_LL and WH_MOUSE_LL only work on NT based systems. If you
want this to work on any Windows OS, you'll need to use WH_KEYBOARD.
And, you can't set a global hook using WH_KEYBOARD from VB.NET...

It is fairly trivial to implement the hook as a C/C++ dll and then call
it from your VB.NET app. If you need an example, let me know. I have
some code I wrote to do this that I could post.

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 1 Build 2600
System Up Time: 0 Days, 11 Hours, 53 Minutes, 23 Seconds

Nov 20 '05 #6
On 2004-02-17, CJ Taylor <no****@blowgoa ts.com> wrote:
Actually, if you have some global hook c++ code for the mouse that would be
awesome... I'm sure I could find some online but hell, why bother.

my email is
cege at839-0- tavayn 3830dot 3422com342

remove numbers and dashes.


CJ,

I haven't forgotten you or not noticed this message... Unfortunately,
the sample code that I had written seems to be among the bunch I lost to
a HD crash a few months ago... Never fear, I worked on putting a little
sample together today. I expect that I will be able to post the results
sometime tommorow :)

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
Only that in you which is me can hear what I'm saying.
-- Baba Ram Dass
Nov 20 '05 #7
Tom,

Much appreciated, I really look forward to seeing it and greatly appreciate
you taking the time to show me.

Thanks,
CJ
"Tom Shelton" <to*@mtogden.co m> wrote in message
news:uU******** *****@TK2MSFTNG P11.phx.gbl...
On 2004-02-17, CJ Taylor <no****@blowgoa ts.com> wrote:
Actually, if you have some global hook c++ code for the mouse that would be awesome... I'm sure I could find some online but hell, why bother.

my email is
cege at839-0- tavayn 3830dot 3422com342

remove numbers and dashes.


CJ,

I haven't forgotten you or not noticed this message... Unfortunately,
the sample code that I had written seems to be among the bunch I lost to
a HD crash a few months ago... Never fear, I worked on putting a little
sample together today. I expect that I will be able to post the results
sometime tommorow :)

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
Only that in you which is me can hear what I'm saying.
-- Baba Ram Dass

Nov 20 '05 #8

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

Similar topics

0
1600
by: piyush | last post by:
Sorry for repeated posting but I couldnt get things right/completely in the first post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application API (which would be set up as a NT service). It could be C++ or C#. The API as such might be talking to the underlying application (UA) via WM_COPYDATA messages.
4
1927
by: davidstummer | last post by:
I was wondering if anyone could point me to an example. Currently i have a c++ program which calls and c++ dll (i created both). The dll uses SendMessage to pass messages back to the calling .exe, and the ..exe process the messages in it's Windows Procedure function WindProc(). What i want is to receive these messages ( the contents of each message will be plain text), in python using a callback (i think this is what i need).
1
5690
by: Artur Kowalski | last post by:
I have a NotifyIcon in my Windows Service project and I am trying to add a ContextMenu to this NotifyIcon or use some of the mouse events. Everything isn't working. I think so base class of the service System.ServiceProcess.ServiceBase don't catchWindows messages like mouse or timer messages. Any Idea? Thanks,
0
1817
by: piyush | last post by:
Sorry for repeated posts, I couldnt get things right and complete in the previous post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application API (which would be set up as a NT service). It could be C++ or C#. The API as such might be talking to the underlying application (UA) via WM_COPYDATA messages.
14
4915
by: Brian Keating EI9FXB | last post by:
I wonder can anyone reccomment a solution to this problem. Let me explain, I've services running on my system, my application receives diagnostic messages from these services, what i want to do is create an MDIChild window for each service that is sending messages. Ok so far so good, but I get problems if one service is constantly sending messages to it's window because, this window is very busy updating it's view, hence because it's...
3
7406
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested in having a look. http://briankeating.net/transfer/test.zip To recap the problem I expected (and found). I've a main GUI thead (main form), this GUI thread has an UpdateTextBox function that appends a string in a textbox and It also has a button...
8
16347
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware of? Thanks for any help Brian
3
1572
by: Javaman59 | last post by:
I've spent the last 3 years programming VC++, and learnt that Windows programming is all about messages. Now I'm doing C#, and there isn't a windows message to be seen! Now, I don't miss those messages at all - in fact I'm very glad to see the end of them, but I am puzzled as to where they've gone. Has .Net got rid of windows messages, or are they just hidden inside the CLR, where windows windows (to use the VC++ term for the real...
14
4111
by: | last post by:
Hi All, I am little confused here, hope you can help me. While processing WM_POWERBROADCAST (wParam=PBT_APMQUERYSUSPEND), I MUST to do some lengthy operation(30 sec) before system Suspends or hibernates. To achieve this, in my message handler when processing PBT_APMQUERYSUSPEND, I create another thread which takes care of making this lengthy operation, and when its done I
3
7489
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I try to connect to my PostgreSQL server using PHPPgAdmin, I
0
9575
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10015
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9842
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7384
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3931
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.