Hi,
I need to write a functionality to catch all Windows Messages from any
Window (like spy++ does). I thought that would be possible by subclassing the
window.
So I wrote a class that inherts from NativeWindow, Assigned a Handle from
another window and overrode the WndProc method.
BUT, I never catch any message EXCEPT if I assign the handle of my own
application's window...
Has anyone done something like this before?
I'm stuck at the moment....
Regards Alexander 2 2998
So,
I have tried to do some basic steps in windows hooking and wrote the
following code. This works fine, at least for some seconds, then the
application freezes and the explorer process is killed =D, what am I doing
wrong?
The hook callback delegate:
public delegate int HookProc(int code, IntPtr wParam, IntPtr lParam);
setting up the hook:
HookProc p = new HookProc(this.C allbackFunction );
this.hook = SetWindowsHookE x(HookType.WH_C ALLWNDPROC, p,
Marshal.GetHINS TANCE(typeof(Cl ass1).Module),0 );
Callback implementation:
private int CallbackFunctio n(int code, IntPtr wParam, IntPtr lParam)
{
if (code < 0)
{
return CallNextHookEx( this.hook, code, wParam, lParam);
}
int ret;
try
{
Message msg = (Message)Marsha l.PtrToStructur e(lParam, typeof(Message) );
Console.WriteLi ne(msg);
}
catch
{
Console.WriteLi ne("exception") ;
}
finally
{
ret = CallNextHookEx( this.hook, code, wParam, lParam);
}
return ret;
}
Regards Alexander
"Andrew Kirillov" wrote: Hello
If you want to trap windows messages of another application you should look at hooks.
Here you can find more information: 1) http://msdn.microsoft.com/library/de...asp?frame=true 2) http://www.codeproject.com/csharp/GlobalSystemHook.asp 3) http://www.codeproject.com/system/hooksys.asp
-- With best regards, Andrew
http://www.codeproject.com/script/pr...asp?id=1181072
"Alexander Wehrli" <Al************ *@discussions.m icrosoft.com> wrote in message news:12******** *************** ***********@mic rosoft.com... Hi,
I need to write a functionality to catch all Windows Messages from any Window (like spy++ does). I thought that would be possible by subclassing the window.
So I wrote a class that inherts from NativeWindow, Assigned a Handle from another window and overrode the WndProc method.
BUT, I never catch any message EXCEPT if I assign the handle of my own application's window...
Has anyone done something like this before?
I'm stuck at the moment....
Regards Alexander This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jan Burgy |
last post by:
Hi all y'all,
Consider the class down below. I've implemented it just because I
needed the pushback method. Now of course the third line in __init__
doesn't work and I even understand why. My question is: is there any
way to make it work? Somebody proposed a patch for fileobject.c to
allow stuff like fp = file(fp1.fileno()) but it looks like it's been
rejected. I won't so bold as to request a change in Python. Should I
try to re-write...
|
by: BJörn Lindqvist |
last post by:
A problem I have occured recently is that I want to subclass builtin
types. Especially subclassing list is very troublesome to me. But I
can't find the right syntax to use. Take for example this class which
is supposed to be a representation of a genome:
class Genome(list):
def __init__(self):
list.__init__(self)
self =
....
|
by: Brent |
last post by:
I'd like to subclass the built-in str type. For example:
--
class MyString(str):
def __init__(self, txt, data):
super(MyString,self).__init__(txt)
self.data = data
|
by: aam |
last post by:
is there a utility for vb.net like spy++ ?
|
by: Jim Garrison |
last post by:
We're considering which XML tool to buy, and it seems to come down
wo XML-Spy vs Oxygen. My personal view is that XML-Spy is kind of
big and slow but has slightly more features than Oxygen. We have
some simple transforms that process 30x faster on large XML files
using Oxygen. There's also a huge difference in price....
Would anyone care to share their experience, especially if you've
worked with both tools?
Thanks
| |
by: Strasser |
last post by:
Problem: Query record selection criteria reads Like & "*"
BUT, then Access changes it to non-functioning Alike &
"*"
Any ideas?
Thank you in advance.
Strasser
|
by: Grant Robertson |
last post by:
I am considering purchasing either XML Spy or Stylus Studio soon. I can
get Stylus Studio Enterprise edition for $350 at academic pricing. The
enterprise edition of XML Spy is about $750 which is too much for me. I
can, however, afford the pro edition at about $400. So, as unfair as it
may seem, my comparison is between XML Spy Pro and Stylus Studio
Enterprise Edition.
My primary purpose is to design a new schema and properly document...
|
by: manatlan |
last post by:
I've got an instance of a class, ex :
b=gtk.Button()
I'd like to add methods and attributes to my instance "b".
I know it's possible by hacking "b" with setattr() methods. But i'd
like to do it with inheritance, a kind of "dynamic subclassing",
without subclassing the class, only this instance "b" !
In fact, i've got my instance "b", and another class "MoreMethods"
|
by: Ray |
last post by:
Hi all,
I am thinking of subclassing the standard string class so I can do
something like:
mystring str;
....
str.toLower ();
A quick search on this newsgroup has found messages by others
|
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...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |