473,387 Members | 1,903 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,387 software developers and data experts.

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 2347
Hi,

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

Ken
----------------------
"Dracolytch" <No****@nowhere.net> wrote in message
news:Y6******************@nwrddc02.gnilink.net...
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.com/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.com/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.com> wrote in message
news:Oi**************@tk2msftngp13.phx.gbl...
In article <10*************@corp.supernews.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****@blowgoats.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.com> wrote in message
news:uU*************@TK2MSFTNGP11.phx.gbl...
On 2004-02-17, CJ Taylor <no****@blowgoats.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
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...
4
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,...
1
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...
0
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...
14
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...
3
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...
8
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...
3
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...
14
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...
3
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...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.