views:

32

answers:

1

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

A: 

Take a look at http://msdn.microsoft.com/en-us/library/ms644990(v=VS.85).aspx

You will need to provide both lpfn and hMod parameters in order to have your DLL injected.

Fyodor Soikin