/** * <summary> * 指定されたWindowInfoWithHandleをWindowRectの位置に移動する * ただしWindowInfoWithHandle.positionXXAdjustmentで位置を補正して隙間ができないようにする * </summary> */ public void MoveWindow(WindowInfoWithHandle windowInfoWithHandle, WindowRect windowRect) { var hWnd = windowInfoWithHandle.windowHandle; var windowRectString = windowRect.ToString(); Logger.WriteLine($"WindowManager.MoveWindow : hWnd={hWnd} To {windowRectString}"); // 最大化、最小化Windowの場合は元のウィンドウにする // if ( IsZoomed(hWnd) || IsIconic(hWnd)) if (IsZoomed(hWnd)) { ShowWindow(hWnd, /* SW_RESTORE = */ 9); } MoveWindow(hWnd, windowRect.GetX() + windowInfoWithHandle.positionLeftAdjustment, windowRect.GetY() + windowInfoWithHandle.positionTopAdjustment, windowRect.GetWidth() + windowInfoWithHandle.positionWidthAdjustment, windowRect.GetHeight() + windowInfoWithHandle.positionHeightAdjustment, /* bRepaint = */ 1); }