Get all windows which overlap my window

不想你离开。 提交于 2019-12-09 03:49:18

问题


I want to find all windows which entirely or partly overlap my window (are on top of it). As a special case, if I have two window handles (hWnd1 and hWnd2), I want to find if hWnd2 partly or completely overlaps hWnd1. The windows in question are desktop windows (not children/siblings in the same process).


回答1:


Iterate the windows that might overlap yours by repeatedly calling GetWindow(), using GW_HWNDPREV. Use GetWindowRect() to check if such a window actually overlap yours. There's no shortcut for two known windows, just check if GetWindow() returns hWnd2 while iterating.



来源:https://stackoverflow.com/questions/2317008/get-all-windows-which-overlap-my-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!