zoukankan      html  css  js  c++  java
  • 实例1.3:获得指定点的窗口

    获得指定点的窗口使用WindowFromPoint函数  

    函数功能:该函数获得包含指定点的窗口的句柄。   

    函数原型:HWND WindowFromPoint(POINT Point);   

    参数:   Point:指定一个被检测的点的POINT结构。   

    返回值S:返回值为包含该点的窗口的句柄。如果包含指定点的窗口不存在,返回值为NULL。如果该点在静态文本控件之上,返回值是在该静态文本控件的下面的窗口的句柄。   

    备注:WindowFromPoint函数不获取隐藏或禁止的窗口句柄,即使点在该窗口内。应用程序应该使用ChildWindowFromPoint函数进行无限制查询,这样就可以获得静态文本控件的句柄。

    	//获得指定点的窗口
    	CWnd* pWnd = WindowFromPoint(point);
    	if (pWnd != NULL)
    	{
    		if (IsChild(pWnd))
    		{
    			CString strText = _T("");
    			pWnd->GetWindowText(strText);
    			SetWindowText(strText);
    		}
    	}
    	CDialog::OnMouseMove(nFlags, point);
    

     另一个函数,IsChild,判断当前窗口是pWnd的子窗口或是CWnd的派生窗口。

    Life is like a box of chocolate, you never know what you are going to get.
  • 相关阅读:
    三、录制脚本Badboy录制脚本1
    三、录制脚本术语
    二、搭建Jmeter环境以及环境变量
    三、录制脚本Jmeter录制脚本2
    一、JMeter相关术语
    MySQL存储引擎
    创建线程CreateThread()
    关于category
    关于异常
    UIView和UIWindow
  • 原文地址:https://www.cnblogs.com/mars9/p/2328033.html
Copyright © 2011-2022 走看看