Sample source code for processing messages of a window created by an external program?
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-04-23T18:06:25Z
Indexed on
2010/04/23
18:43 UTC
Read the original article
Hit count: 328
I know I have to use SetWindowLongPtr with GWLP_WNDPROC and create my own WndProc that handles the message I want (such as WM_GETMINMAXINFO and modify the MINMAXINFO structure). However, because I want to do this for a window created by another program (like notepad.exe), I can't do this from my C#/WinForms program, I have to create a native C/C++ DLL that I have to inject in the the process that created the window.
Can you provide a link or the sample code to do this (the native C++ DLL and the way to call it from C# and inject it into the external process)?
Thank you
© Stack Overflow or respective owner