且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

vc ++替换WndProc形成另一个应用程序窗口

更新时间:2023-12-06 15:23:28



如果您尝试从低级键盘挂钩创建的线程中替换窗口proc,则dll不会注入到目标进程中.您需要将您的dll注入目标进程并替换窗口proc,这肯定可以工作.并且确保您将能够从根本不支持WM_GETTEXT的窗口/控件中获取文本.控件/窗口的所有者可以直接绘制该文本.在那种情况下,替换窗口proc只会导致文本不显示在窗口中.在这种情况下,您需要执行API挂钩/GDI挂钩才能从窗口/控件中获取文本

希望对您有所帮助.
Hi,

If you are trying to replace the window proc from a thread that created by a low level keyboard hook then the dll is not injected into the target process. You need to inject your dll to the target process and replace the window proc definitely this will work. And are sure you will be able to get the text from a window/control that doesn''t support WM_GETTEXT at all?. The owner of the control/window may directly drawing that text. In that case replacing the window proc simply causes the text to be not displayed in the window. In such a situation you need to do API hook/GDI hook to get text from the window/control

hope this helps.


您好

如果仅查找EDIT框,则可以通过钩住窗口过程并将其子类化.
Hi

if you only looking for EDIT box then this is possible by hooking and subclassing the window procedure.


您是否要在另一个进程中将EDIT框子类化?如果是,则需要注入dll并替换win proc
Are you trying to subclass an EDIT box in another process? If yes you need to inject your dll and replace the win proc