473,583 Members | 3,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looking for Hooking

Hi,
Is it possible to hook another application's WM_MOVE messages using c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?

Thanks,
James Randle

Jul 17 '06 #1
12 2694
pigeonrandle <pi**********@h otmail.comwrote :
Hi,
Is it possible to hook another application's WM_MOVE messages using c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?
There is always unmanaged code that could be used ;-)

--
Thomas T. Veldhouse
Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1

Jul 17 '06 #2
Thomas ,
I don't really mind how it's done as long as it works. I've never tried
hooking beofre and would like to 'get it right' 'the first time' if you
know what i mean?!

James.

Thomas T. Veldhouse wrote:
pigeonrandle <pi**********@h otmail.comwrote :
Hi,
Is it possible to hook another application's WM_MOVE messages using c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?

There is always unmanaged code that could be used ;-)

--
Thomas T. Veldhouse
Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1
Jul 17 '06 #3
Here are some resources I've collected on this subject:

http://www.codeguru.com/Cpp/W-P/syst...php/c5667#more
http://www.codeproject.com/csharp/NetWin32Hooks.asp
http://www.codeproject.com/csharp/globalsystemhook.asp

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"pigeonrand le" <pi**********@h otmail.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Hi,
Is it possible to hook another application's WM_MOVE messages using c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?

Thanks,
James Randle

Jul 17 '06 #4
Kevin,
Cheers for the reply dude. My browser is telling me i've already looked
at one of those (at which point i probably thought 'maybe theres an
easier way'!).

Thanks again,
James

Kevin Spencer wrote:
Here are some resources I've collected on this subject:

http://www.codeguru.com/Cpp/W-P/syst...php/c5667#more
http://www.codeproject.com/csharp/NetWin32Hooks.asp
http://www.codeproject.com/csharp/globalsystemhook.asp

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"pigeonrand le" <pi**********@h otmail.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Hi,
Is it possible to hook another application's WM_MOVE messages using c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?

Thanks,
James Randle
Jul 17 '06 #5
Hello pigeonrandle,

Take a look at the NativeWindow class.

-Boo
Hi,
Is it possible to hook another application's WM_MOVE messages using
c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?
Thanks,
James Randle

Jul 17 '06 #6
GhostInAK wrote:
Hello pigeonrandle,

Take a look at the NativeWindow class.

-Boo
>Hi,
Is it possible to hook another application's WM_MOVE messages using
c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?
Thanks,
James Randle
Hi Boo,

Unfortunately, you cannot subclass a foreign process' window procedure.

--
Hope this helps,
Tom Spink

Google first, ask later.
Jul 17 '06 #7
Tom's right - i just tried it :(.

I dont suppose anyone has a specific example do they. I seem to have
about 4 projects on the go and am getting confused .-(

Cheers again,
James

Tom Spink wrote:
GhostInAK wrote:
Hello pigeonrandle,

Take a look at the NativeWindow class.

-Boo
Hi,
Is it possible to hook another application's WM_MOVE messages using
c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?
Thanks,
James Randle

Hi Boo,

Unfortunately, you cannot subclass a foreign process' window procedure.

--
Hope this helps,
Tom Spink

Google first, ask later.
Jul 17 '06 #8
Hello Tom,

Ah.. then in that case one would need to use the Win32 SetWindowLong function.

-Boo
GhostInAK wrote:
>Hello pigeonrandle,

Take a look at the NativeWindow class.

-Boo
>>Hi,
Is it possible to hook another application's WM_MOVE messages using
c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?
Thanks,
James Randle
Hi Boo,

Unfortunately, you cannot subclass a foreign process' window
procedure.

Google first, ask later.

Jul 18 '06 #9
Ghost,
Alas, you cannot use SetWindowLong on another process's window.

http://windowssdk.msdn.microsoft.com.../ms633591.aspx

But i did find this example, which is not only cool, but implements the
sort of global hook 'everyone seems to be after' - one that traps
messages from other windows.

http://www.codeproject.com/system/Mi...ndowToTray.asp

It's well commented too. Wahey :)

Cheers for your help,
James.
GhostInAK wrote:
Hello Tom,

Ah.. then in that case one would need to use the Win32 SetWindowLong function.

-Boo
GhostInAK wrote:
Hello pigeonrandle,

Take a look at the NativeWindow class.

-Boo

Hi,
Is it possible to hook another application's WM_MOVE messages using
c#?
There seems to be some argument as to what messages you can hook and
whether you can listen in on other app's messages using .net.
I'm just looking for a straight answer really?
Thanks,
James Randle
Hi Boo,

Unfortunately, you cannot subclass a foreign process' window
procedure.

Google first, ask later.
Jul 18 '06 #10

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

Similar topics

1
1268
by: Raja | last post by:
Dears, I apologize in advance if this is the wrong place to post, sorry for the inconvenience. Is there any book or web site or any kind of resource is available for Windows hooking and subcalssing in C# / VB.Net (in general .Net)? OR, is there any link in Microsoft sites / MSDN ?
0
1164
by: Jim Hubbard | last post by:
Is GDI Hooking possible in VB.Net?
3
1683
by: Seth Gecko | last post by:
Hi I want to make an application (in C#) that can catch text written to a Richedit control in another application. Using Spy++ I can see that the message I want to intercept is called EM_REPLACESEL. I have been googling and I am pretty sure that the way forward is using SetWindowsHookEx, but the hook I should use, I am not so sure about....
79
5228
by: pinkfloydhomer | last post by:
I want to scan a file byte for byte for occurences of the the four byte pattern 0x00000100. I've tried with this: # start import sys numChars = 0 startCode = 0 count = 0
3
4475
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events. Whenever I hook any of the HTMLDocumnetEvent2_Event events like this: HTMLDocumentEvents2_Event DocEvents = this.Browser.Document as...
2
1476
by: wetrain | last post by:
Hi , I looking for Windows API hooking SDK , i found in google , but all links are broken ..... If somebody have that API, please send to me !! thank´s!
5
2013
by: Ryan Ginstrom | last post by:
Apropos recent threads about GUI editors, coming from a Win32/WTL C++ background, I actually like the idea of being able to (easily) create GUIs programmatically. But I still see a lot of the same tedium: hooking up events to handlers, and getting data into and out of dialogs. In C++, this is generally handled through code generation and/or...
8
1959
by: pigeonrandle | last post by:
Hi, Has anyone had any experience with hooking messages in other application windows (like SPY++). I want to listen for WM_MOVE messages, but can only seem to find examples of Keyboard and Mouse hooks. Please (and thankyou), James Randle.
0
3733
by: joemango | last post by:
Hi everyone, I was just reading the following artilce titled: "Spy: A Windows CE API Interceptor" by Dmitri Leman in Dr. Dobbs Journal, September 02, 2003 located at http://www.ddj.com/184405459?pgno=1 the article presents source code that includes a dll file which holds all the hooking procedures it is written in C++. Is there an...
0
8182
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. ...
0
8327
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...
1
7935
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...
0
6579
agi2029
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...
0
5374
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...
0
3818
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...
0
3843
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1433
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1157
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...

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.