Exemplo n.º 1
0
        private void MoveLeftWithThird()
        {
            IntPtr activeWindow;
            int    top, left, height, width;

            activeWindow = WindowsManagementExternals.GetActiveWindowAndScreen(out top, out left, out height, out width);

            WindowsManagementExternals.MoveWindow(activeWindow, left, top, width / 3, height, true);
        }
Exemplo n.º 2
0
        private void MoveTopWithFullSize()
        {
            IntPtr activeWindow;
            int    top, left, height, width;

            activeWindow = WindowsManagementExternals.GetActiveWindowAndScreen(out top, out left, out height, out width);

            WindowsManagementExternals.MoveWindow(activeWindow, left, top, width, height / 2, true);
        }
Exemplo n.º 3
0
        private void FillScreenCentered()
        {
            IntPtr activeWindow;
            int    top, left, height, width;

            activeWindow = WindowsManagementExternals.GetActiveWindowAndScreen(out top, out left, out height, out width);

            WindowsManagementExternals.MoveWindow(activeWindow, left, top, width, height, true);
        }
Exemplo n.º 4
0
        private void MoveBottomLeftWithHalf()
        {
            IntPtr activeWindow;
            int    top, left, height, width;

            activeWindow = WindowsManagementExternals.GetActiveWindowAndScreen(out top, out left, out height, out width);

            int offsetVertical = height / 2;

            WindowsManagementExternals.MoveWindow(activeWindow, left, top + offsetVertical, width / 2, height / 2, true);
        }
Exemplo n.º 5
0
        private void MoveTopWithTwoThirdsSize()
        {
            IntPtr activeWindow;
            int    top, left, height, width;

            activeWindow = WindowsManagementExternals.GetActiveWindowAndScreen(out top, out left, out height, out width);

            int newWidth     = 2 * (width / 3);
            int missingSpace = width - newWidth;
            int offset       = missingSpace / 2;

            WindowsManagementExternals.MoveWindow(activeWindow, left + offset, top, 2 * (width / 3), height / 2, true);
        }
        private void MoveTopRightWithHalfWidthSize()
        {
            IntPtr activeWindow;
            int    top, left, height, width;

            activeWindow = WindowsManagementExternals.GetActiveWindowAndScreen(out top, out left, out height, out width);

            int newWidth     = (width / 2);
            int missingSpace = width - newWidth;
            int offset       = missingSpace;

            WindowsManagementExternals.MoveWindow(activeWindow, left + offset, top, width, height / 2, true);
        }
Exemplo n.º 7
0
        private void MoveBottomWithThirdWidthSize()
        {
            IntPtr activeWindow;
            int top, left, height, width;
            activeWindow = WindowsManagementExternals.GetActiveWindowAndScreen(out top, out left, out height, out width);

            int newWidth = (width / 3);
            int missingSpace = width - newWidth;
            int offset = missingSpace / 2;

            int offsetVertical = height / 2;

            WindowsManagementExternals.MoveWindow(activeWindow, left+offset, top + offsetVertical, newWidth, height / 2, true);
        }