ReactOS 0.4.16-dev-141-g4c84e19
SetWindowPlacement.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS API tests
3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4 * PURPOSE: Tests for Get/SetWindowPlacement
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "precomp.h"
9
11{
12 HWND hwnd;
13 WINDOWPLACEMENT wndpl;
14 BOOL ret;
15
16 hwnd = CreateWindowW(L"BUTTON", L"Button", WS_POPUPWINDOW, 0, 0, 100, 100,
18
19 SetLastError(0xDEADFACE);
20 wndpl.length = 0xFFFF;
21 ret = GetWindowPlacement(hwnd, &wndpl);
22 ok_int(ret, TRUE);
23 ok_err(0xDEADFACE);
24
25 SetLastError(0xDEADFACE);
26 wndpl.length = sizeof(wndpl);
27 ret = GetWindowPlacement(hwnd, &wndpl);
28 ok_int(ret, TRUE);
29 ok_err(0xDEADFACE);
30
31 SetLastError(0xDEADFACE);
32 wndpl.length = 0xFFFF;
33 ret = SetWindowPlacement(hwnd, &wndpl);
36
37 SetLastError(0xDEADFACE);
38 wndpl.length = sizeof(wndpl);
39 ret = SetWindowPlacement(hwnd, &wndpl);
40 ok_int(ret, TRUE);
42
44}
#define ok_err(error)
Definition: atltest.h:124
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
unsigned int BOOL
Definition: ntddk_ex.h:94
#define L(x)
Definition: ntvdm.h:50
#define WS_POPUPWINDOW
Definition: pedump.c:638
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319
BOOL WINAPI SetWindowPlacement(_In_ HWND hWnd, _In_ const WINDOWPLACEMENT *)
BOOL WINAPI DestroyWindow(_In_ HWND)