没有不可能 发表于 2017-6-3 11:03:29

几种枚举窗口的方法(包括猥琐的你懂得)

老生常谈的枚举那些就不说了
说一些很少有人处理的

POINTpt;
GetCursorPos(&pt);
hd=WindowFromPhysicalPoint(pt);
if(hd!=NULL)
{
GetWindowTextA(hd,text,260);
printf("text:%s\n",text);
Sleep(2000);
}
获取当前鼠标所在位置的窗口
随便写个demo在vista以上就antisod
GetCursorPos(&pt);
ScreenToClient(GetDesktopWindow(),&pt);
hd=ChildWindowFromPoint(GetDesktopWindow(),pt);
if(hd!=NULL){

GetWindowTextA(hd,text,260);
printf("text:%s\n",text);
Sleep(2000);


}*/
从某个坐标处开始枚举实际上是枚举的hwd内的窗口坐标要转换成用户坐标

查色比对的就不说了~

很多人爱用的

HWNDhChild=::GetWindow(ParentWnd,GW_CHILD);
for(;hChild!=NULL;hChild=::GetWindow(hChild,GW_HWNDNEXT))
{

}

HWNDWINAPIRealChildWindowFromPoint(
_In_HWNDhwndParent,
_In_POINTptParentClientCoords
);
PhysicalToLogicalPoint

检测隐藏窗口的话就有N+!种方法了太多不说了


以上是相对猥琐的东西了~~~
页: [1]
查看完整版本: 几种枚举窗口的方法(包括猥琐的你懂得)