强制窗口使用Detour重新绘制自身 [英] force a window to repaint itself using Detour

查看:84
本文介绍了强制窗口使用Detour重新绘制自身的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于第三方对话框的桌面应用程序.我们说"abc.exe".我没有源代码"abc",应用程序,但仅限二进制文件.我想阅读对话框各个项目上显示的文本.使用Detours程序包, 我已成功钩住(绕行了)"DrawText" win32 api和i能够拦截正在写入对话框各个项目的文本,但仅当更新各个控制项目时才可以. 没有更新,我无法阅读控制项上显示的文本.

一种可行的解决方案是,我强制更新对话框/窗口,以便它重新绘制自身并调用"DrawText". api,然后我将拦截并阅读它的文本.

请让我知道一个解决方案,通过该解决方案,我将强制刷新窗口/对话框或其他符合我要求的解决方案.

我的要求也是在VC ++/Win32中.

 

致谢

苏曼

         

 

解决方案

您可以尝试以下操作-

使用 EnumWindows EnumChildWindows 获取对话框控件的句柄.

WM_GETTEXT 发送到这些控件以读取其文本.


Hi

I have a third party dialog based desktop application. let's say "abc.exe". I dont have the source code of "abc" application, but only binaries. I want to read the text displayed, on various items of the dialog box. Using detours package, i have sucessfully hooked (detoured) the "DrawText" win32 api, and i am able to intercept the text that is being written to various items of the dialog box, but only when the various control items are being updated. If the control items are not being updated i am not able to read the text that is being displayed on the control items.

One posible solution may be that i forcefully update the dialog/window, so that it repaints itself and calls the "DrawText" api, which will i then intercept and read it's text.

Please let me know a solution using which i will forcefully refresh the window/dialog box, or any other soluton to my requirement.

And also my requiremnt is in VC++/Win32.

 

Regards

Suman

          

 

解决方案

Here is something you can try -

Get the handle to the dialog controls using EnumWindows and EnumChildWindows.

Send the WM_GETTEXT to these controls to read its text.


这篇关于强制窗口使用Detour重新绘制自身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆