diff --git a/modules/rostests/apitests/user32/CMakeLists.txt b/modules/rostests/apitests/user32/CMakeLists.txt index e49fad457b2..7dd1be59361 100644 --- a/modules/rostests/apitests/user32/CMakeLists.txt +++ b/modules/rostests/apitests/user32/CMakeLists.txt @@ -51,6 +51,7 @@ list(APPEND SOURCE SetProp.c SetScrollInfo.c SetScrollRange.c + SetWindowPlacement.c ShowWindow.c SwitchToThisWindow.c SystemMenu.c diff --git a/modules/rostests/apitests/user32/SetWindowPlacement.c b/modules/rostests/apitests/user32/SetWindowPlacement.c new file mode 100644 index 00000000000..7f5fb98e549 --- /dev/null +++ b/modules/rostests/apitests/user32/SetWindowPlacement.c @@ -0,0 +1,44 @@ +/* + * 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 + */ + +#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); +} diff --git a/modules/rostests/apitests/user32/testlist.c b/modules/rostests/apitests/user32/testlist.c index 3e90ebfcfbd..24e66096de1 100644 --- a/modules/rostests/apitests/user32/testlist.c +++ b/modules/rostests/apitests/user32/testlist.c @@ -52,6 +52,7 @@ extern void func_SetParent(void); extern void func_SetProp(void); extern void func_SetScrollInfo(void); extern void func_SetScrollRange(void); +extern void func_SetWindowPlacement(void); extern void func_ShowWindow(void); extern void func_SwitchToThisWindow(void); extern void func_SystemParametersInfo(void); @@ -112,6 +113,7 @@ const struct test winetest_testlist[] = { "SetProp", func_SetProp }, { "SetScrollInfo", func_SetScrollInfo }, { "SetScrollRange", func_SetScrollRange }, + { "SetWindowPlacement", func_SetWindowPlacement }, { "ShowWindow", func_ShowWindow }, { "SwitchToThisWindow", func_SwitchToThisWindow }, { "SystemMenu", func_SystemMenu },