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

来源:互联网 发布:有域名怎么免费建网站 编辑:程序博客网 时间:2024/05/17 09:06
老生常谈的枚举那些就 不说了
说一些 很少有人处理的

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

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


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

查色 比对的就不说了~

很多人爱用的
  
  HWND hChild = ::GetWindow(ParentWnd, GW_CHILD);
  for (;hChild != NULL; hChild = ::GetWindow(hChild, GW_HWNDNEXT))
  {

}

HWND WINAPI RealChildWindowFromPoint(
  _In_ HWND  hwndParent,
  _In_ POINT ptParentClientCoords
);
PhysicalToLogicalPoint

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


以上 是 相对猥琐的东西了~~~ 

0 0
原创粉丝点击