コード例 #1
0
        /// <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);
        }
コード例 #2
0
 //ウィンドウハンドルからRECT取得
 private static API.RECT GetWindowAPIRECT(IntPtr hWnd)
 {
     _ = API.GetWindowRect(hWnd, out API.RECT re);
     return(re);
 }
コード例 #3
0
 //ウィンドウハンドルからRect取得
 private Rect GetWindowRect(IntPtr hWnd)
 {
     _ = API.GetWindowRect(hWnd, out API.RECT re);
     return(MyConverterApiRectToRect(re));
 }