mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 07:36:05 +00:00
[USER32_APITEST] Power to DM_REPOSITION testcase (#2055)
- Add the minimized case. - Add a test for WS_DISPLAYCHANGE message. CORE-16490
This commit is contained in:
parent
e4de098127
commit
2a93f61fcb
2 changed files with 40 additions and 3 deletions
|
@ -10,10 +10,11 @@
|
||||||
|
|
||||||
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
|
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
|
||||||
{
|
{
|
||||||
RECT rc, rcWork;
|
RECT rc, rc2, rcWork;
|
||||||
INT cx, cy;
|
INT cx, cy, nBitsPixel;
|
||||||
HMONITOR hMon;
|
HMONITOR hMon;
|
||||||
MONITORINFO mi = { sizeof(mi) };
|
MONITORINFO mi = { sizeof(mi) };
|
||||||
|
HDC hdc;
|
||||||
|
|
||||||
/* get monitor info */
|
/* get monitor info */
|
||||||
hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
|
hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
|
||||||
|
@ -63,6 +64,42 @@ static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
|
||||||
ok_long(rc.right, rc.left + cx);
|
ok_long(rc.right, rc.left + cx);
|
||||||
ok_long(rc.bottom, rc.top + cy);
|
ok_long(rc.bottom, rc.top + cy);
|
||||||
|
|
||||||
|
/* minimize */
|
||||||
|
ShowWindow(hwnd, SW_MINIMIZE);
|
||||||
|
ok_int(GetWindowRect(hwnd, &rc), TRUE);
|
||||||
|
|
||||||
|
/* reposition */
|
||||||
|
ok_int(SendMessageW(hwnd, DM_REPOSITION, 0, 0), 0);
|
||||||
|
ok_int(GetWindowRect(hwnd, &rc2), TRUE);
|
||||||
|
ok_int(EqualRect(&rc, &rc2), TRUE);
|
||||||
|
|
||||||
|
/* restore */
|
||||||
|
ShowWindow(hwnd, SW_RESTORE);
|
||||||
|
|
||||||
|
/* move */
|
||||||
|
ok_int(SetWindowPos(hwnd, NULL,
|
||||||
|
rcWork.right - cx + 80, rcWork.bottom - cy + 80, 0, 0,
|
||||||
|
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOOWNERZORDER |
|
||||||
|
SWP_NOZORDER), TRUE);
|
||||||
|
ok_int(GetWindowRect(hwnd, &rc), TRUE);
|
||||||
|
ok_long(rc.left, rcWork.right - cx + 80);
|
||||||
|
ok_long(rc.top, rcWork.bottom - cy + 80);
|
||||||
|
ok_long(rc.right, rc.left + cx);
|
||||||
|
ok_long(rc.bottom, rc.top + cy);
|
||||||
|
|
||||||
|
/* WM_DISPLAYCHANGE */
|
||||||
|
hdc = GetWindowDC(hwnd);
|
||||||
|
nBitsPixel = GetDeviceCaps(hdc, BITSPIXEL);
|
||||||
|
ReleaseDC(hwnd, hdc);
|
||||||
|
SendMessageW(hwnd, WM_DISPLAYCHANGE, nBitsPixel,
|
||||||
|
MAKELONG(GetSystemMetrics(SM_CXSCREEN),
|
||||||
|
GetSystemMetrics(SM_CYSCREEN)));
|
||||||
|
ok_int(GetWindowRect(hwnd, &rc), TRUE);
|
||||||
|
ok_long(rc.left, rcWork.right - cx + 80);
|
||||||
|
ok_long(rc.top, rcWork.bottom - cy + 80);
|
||||||
|
ok_long(rc.right, rc.left + cx);
|
||||||
|
ok_long(rc.bottom, rc.top + cy);
|
||||||
|
|
||||||
/* quit */
|
/* quit */
|
||||||
PostMessage(hwnd, WM_COMMAND, IDOK, 0);
|
PostMessage(hwnd, WM_COMMAND, IDOK, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -33,7 +33,7 @@ FONT 8, "MS Shell Dlg"
|
||||||
}
|
}
|
||||||
|
|
||||||
REPOSITION DIALOG 0, 0, 200, 150
|
REPOSITION DIALOG 0, 0, 200, 150
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE WS_OVERLAPPEDWINDOW
|
||||||
CAPTION "DM_REPOSITION"
|
CAPTION "DM_REPOSITION"
|
||||||
FONT 8, "MS Shell Dlg"
|
FONT 8, "MS Shell Dlg"
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue