用WindowFromPoint()函数来获得鼠标所在位置的窗口的句柄--发生一个关闭窗口的消息---关闭鼠标所在的窗口
来源:互联网 发布:淘宝网新款针织衫 编辑:程序博客网 时间:2024/05/13 04:20
#include "stdafx.h"
#include <Windows.h>
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
POINT curpos;
while (TRUE)
{
GetCursorPos(&curpos);
HWND wnd = WindowFromPoint(curpos);
SendMessage(wnd, WM_CLOSE, 0, 0);
Sleep(1000);
}
return 0;
}
HWND WindowFromPoint( POINT Point);
Return ValueReturns a handle to the window that contains the x-y coordinates to indicate success. Returns NULL to indicate that no window exists at the specified x-y coordinates.
//返回一个句柄,表示成功,返回NULL表示失败. 返回的这个窗口句柄是: 鼠标curpos结构体所在窗口里面的句柄被返回.
//句柄是一个整数.
Remarks
The WindowFromPoint function does not retrieve a handle to a hidden or disabled window, even if the x-y coordinate is within the window. To determine if child windows of a parent window contain an x-y coordinate, use the ChildWindowFromPoint function.
//这个函数不检索窗口被disabled的,不检索窗口被隐藏的,不返回这两个类型的句柄.
阅读全文
0 0
- 用WindowFromPoint()函数来获得鼠标所在位置的窗口的句柄--发生一个关闭窗口的消息---关闭鼠标所在的窗口
- WinAPI: WindowFromPoint- 获取指定点所在窗口的句柄
- WindowFromPoint -- 获得包含指定点的窗口的句柄
- 窗口关闭的消息路由
- 窗口句柄的获得
- 窗口句柄的获得
- 窗口句柄的获得
- 窗口句柄的获得
- 窗口句柄的获得
- 窗口句柄的获得
- 取得鼠标下的窗口句柄
- 建立控制台程序--获得已经打开的一个窗口的句柄--给这个窗口发送一个关闭命令
- 获得鼠标所指的窗口的内容
- GetCapture获得一个窗口的句柄,这个窗口位于当前输入线程,且拥有鼠标捕获(鼠标活动由它接收)
- 注入窗口的发送鼠标消息
- 如何处理窗口的鼠标离开消息
- 监听button窗口鼠标mouse_over的消息
- 如何处理鼠标离开窗口的消息
- CentOS7安装percona-xtrabackup时/etc/my.cnf冲突报错解决
- 关于取网络适配器MAC地址时候遇到的编译问题
- 动态存储分配(堆分配)的顺序串与顺序表在操作上的异同
- php递归与迭代实现斐波那契数列
- Agilent.GoldenGate.RFIC.Simulation.2015.01.v4.9.0.Win64 1CD(RTL验证标准)
- 用WindowFromPoint()函数来获得鼠标所在位置的窗口的句柄--发生一个关闭窗口的消息---关闭鼠标所在的窗口
- JS刷新父窗口
- Android事件分发机制完全解析,带你从源码的角度彻底理解(下)
- 浅谈.h .cpp
- python基础入门四
- oracle中merge into用法
- Largest Rectangle in a Histogram POJ
- JS的函数参数传递
- 解决使用TortoiseGit后文件夹出现蓝色问号