示例#1
0
        public static WindowInfo GetWindowInfo(IntPtr hwnd)
        {
            WindowInfo wnfo = new WindowInfo();

            wnfo.cbSize = Marshal.SizeOf(wnfo);
            if (!Api_User32.GetWindowInfo(hwnd, ref wnfo))
            {
                throw new Win32Exception(Marshal.GetLastWin32Error(), "Unable to retrieve window information.");
            }
            return(wnfo);
        }