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

wndproc override

cs
I have been playing around with overriding the wndproc method on a winform.
Now I am wondering, can you override the winproc method on any window even
if they arent a .net widnow? I see some example on the nativewindow class
but it didnt work when I pointed it at the windowhandle of a window that
wasnt my own!
Any ideas on how to do this?
Nov 16 '05 #1
3 2769

Using NativeWindow should work for windows created in your own
process.

Handling messages for windows in other processes is non-trivial, it
requires using hooking or code injection.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
cs
> Handling messages for windows in other processes is non-trivial, it
requires using hooking or code injection.


can it be done from c#? examples?
Nov 16 '05 #3

No this is one of those things you should use native code for if you
really have to do it.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #4

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

Similar topics

0
by: sshuangw | last post by:
Hello: I am encountering a very weird issue with MDI child, Overriden WndProc function and hidden form. Basically, the application has two forms, Form1(parent form), Form2(Child form),...
2
by: Martin Müller | last post by:
Hi folks! I have a .NET RichTextBox derived class which has to react differently to WM_GETTEXT (and some other messages) than it does by default (mainly converting between \n and \r\n). I...
2
by: Ed Sutton | last post by:
How can a WndProc be created inside a component? Currently I have a WndProc in my frmMain. It looks for WM_DEVICECHANGE messages for connection and removal events for a USB/Serial device. My...
0
by: cyrille | last post by:
Hello from example from web i did a little code to avoiding columnHeader resize. this code seems to work well, but when I put a 'normal' ListView on the same Form than my overrided ListView it...
0
by: han.phony | last post by:
Hi, I am trying to intercept the message sent back by winmm.dll's mciSendString method when playback is finished. I tried to override the WndProc in the form but I didn't get/intercept the message,...
2
by: dworthem | last post by:
if I have the compiler option /clr:oldSyntax in a Windows Forms application protected: void WndProc(System::Windows::Forms::Message* m) is called If I remove oldSyntax protected:
2
by: Derrick | last post by:
Hello all; I'm trying to create a UI that's a little atypical. In the main form's Paint event handler, I draw an image on the form - this is what I want to by my "real" UI. I turned off the...
2
by: shengmin.ruan | last post by:
when i use delegate like this: ----------------- protected override void WndProc(ref Message m) { delegate_ReplyFromDataProcess = new...
4
by: Rob | last post by:
I've constructed a user control inherited from ListView so I can handle and respond to scrolling events (to keep 2 listviews scrolling in sync). My user control includes an Overrides of WndProc...
3
by: Newbie Coder | last post by:
I am trying to override WndProc like I would in this VB.NET sub. How do I do it? <System.Security.Permissions.PermissionSetAttribute(System.Security.Permissi ons.SecurityAction.Demand,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.