获取窗口的句柄 [英] Get the HANDLE of a window

查看:85
本文介绍了获取窗口的句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我通过调用函数ShellExecute启动了外部应用程序,然后获得了该应用程序的进程句柄,然后如何通过该应用程序的进程句柄获得该应用程序的窗口句柄?

hello,everyone.
I have started a external application by calling the function ShellExecute,then I get the process handle of the application ,and after that how can I get the Window Handle of the application through the process handle of the application?
thanks.

推荐答案

看这里: http: //www.codeguru.com/forum/showthread.php?threadid=273507 [ http://support.microsoft.com/kb/242308 [
Look Here : http://www.codeguru.com/forum/showthread.php?threadid=273507[^]
http://support.microsoft.com/kb/242308[^]


我已经通过调用函数FindWindow()来解决此问题前提是该窗口的句柄必须只有一个窗口.因为当多个窗口具有相同的标题时,这是错误的.
I have solve this problem by calling the function FindWindow() to get the Handle of the window with a precondition that it must be only one window exist.Because it will be wrong when there are several windows with the same caption.


这篇关于获取窗口的句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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