BrowserTools.Utils.GetWindowInfo C# (CSharp) Метод

GetWindowInfo() приватный Метод

private GetWindowInfo ( IntPtr hWnd, WindowInfo &pwi ) : IntPtr
hWnd System.IntPtr
pwi WindowInfo
Результат System.IntPtr
        static extern IntPtr GetWindowInfo(IntPtr hWnd, out WindowInfo pwi);

Same methods

Utils::GetWindowInfo ( IntPtr hWnd ) : WindowInfo

Usage Example

Пример #1
0
        static void PlaceWindowOnScreen(IntPtr hWnd)
        {
            if (IsZoomed(hWnd))
            {
                return;
            }

            WindowInfo wi = Utils.GetWindowInfo(hWnd);

            int maxVisibleArea = 0;

            Rectangle resultWindowRect = new Rectangle();

            bool found = false;

            foreach (var s in Screen.AllScreens)
            {
                int visibleArea = GetWindowVisibleArea(wi, s);

                if (visibleArea > maxVisibleArea)
                {
                    maxVisibleArea = visibleArea;

                    resultWindowRect = GetVisibleRectangle(wi, s);

                    found = true;
                }
            }

            if (found)
            {
                MoveWindow(hWnd, resultWindowRect.X, resultWindowRect.Y, resultWindowRect.Width, resultWindowRect.Height, true);
            }
        }
All Usage Examples Of BrowserTools.Utils::GetWindowInfo