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); }
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); }
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); }
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); }
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); }
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); }