reactos/modules/rostests/apitests/user32/SetWindowPlacement.c
Katayama Hirofumi MZ 172d65327b
[USER32_APITEST] Add SetWindowPlacement testcase (#7082)
Verify behavior of NtUserSetWindowPlacement
function.
JIRA issue: N/A
Add SetWindowPlacement testcase into
user32_apitest.
2024-07-08 00:34:18 +09:00

45 lines
1.1 KiB
C

/*
* PROJECT: ReactOS API tests
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
* PURPOSE: Tests for Get/SetWindowPlacement
* COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#include "precomp.h"
START_TEST(SetWindowPlacement)
{
HWND hwnd;
WINDOWPLACEMENT wndpl;
BOOL ret;
hwnd = CreateWindowW(L"BUTTON", L"Button", WS_POPUPWINDOW, 0, 0, 100, 100,
NULL, NULL, GetModuleHandleW(NULL), NULL);
SetLastError(0xDEADFACE);
wndpl.length = 0xFFFF;
ret = GetWindowPlacement(hwnd, &wndpl);
ok_int(ret, TRUE);
ok_err(0xDEADFACE);
SetLastError(0xDEADFACE);
wndpl.length = sizeof(wndpl);
ret = GetWindowPlacement(hwnd, &wndpl);
ok_int(ret, TRUE);
ok_err(0xDEADFACE);
SetLastError(0xDEADFACE);
wndpl.length = 0xFFFF;
ret = SetWindowPlacement(hwnd, &wndpl);
ok_int(ret, FALSE);
ok_err(ERROR_INVALID_PARAMETER);
SetLastError(0xDEADFACE);
wndpl.length = sizeof(wndpl);
ret = SetWindowPlacement(hwnd, &wndpl);
ok_int(ret, TRUE);
ok_err(ERROR_SUCCESS);
DestroyWindow(hwnd);
}