/// <summary> /// ドロップシャドウ用のウィンドウを判定して、取り除いて返す /// </summary> /// <param name="wLisnt"></param> /// <returns></returns> private List <IntPtr> DeleteShadowWindow(List <IntPtr> wLisnt) { List <IntPtr> result = new(); result.Add(wLisnt[0]); _ = API.GetWindowRect(wLisnt[0], out API.RECT preRECT); //API.RECT preRECT = GetWindowRect(wLisnt[0]); for (int i = 1; i < wLisnt.Count; i++) { //前後のRectのleftとtopが同じならドロップシャドウと判定して //リストには加えない _ = API.GetWindowRect(wLisnt[i], out API.RECT imaRECT); if (imaRECT.left != preRECT.left || imaRECT.top != preRECT.top) { result.Add(wLisnt[i]); } preRECT = imaRECT; } return(result); }
//ウィンドウハンドルからRECT取得 private static API.RECT GetWindowAPIRECT(IntPtr hWnd) { _ = API.GetWindowRect(hWnd, out API.RECT re); return(re); }
//ウィンドウハンドルからRect取得 private Rect GetWindowRect(IntPtr hWnd) { _ = API.GetWindowRect(hWnd, out API.RECT re); return(MyConverterApiRectToRect(re)); }