ReactOS 0.4.15-dev-7961-gdcf9eb0
GetSetWindowInt.c File Reference
#include "precomp.h"
Include dependency graph for GetSetWindowInt.c:

Go to the source code of this file.

Functions

 START_TEST (GetSetWindowInt)
 

Function Documentation

◆ START_TEST()

START_TEST ( GetSetWindowInt  )

Definition at line 10 of file GetSetWindowInt.c.

11{
12 WNDCLASSEXW wcex = { 0 };
13 ATOM atom;
14 HWND hwnd;
15
16 wcex.cbSize = sizeof(WNDCLASSEXW);
17 wcex.style = 0x1;
19 wcex.cbClsExtra = 1;
20 wcex.cbWndExtra = 5;
22 wcex.lpszClassName = L"ProTestClass1";
23
24 atom = RegisterClassExW(&wcex);
25 ok(atom != 0, "Failed to register class!\n");
26
28 L"WindowTitle",
34 NULL,
35 NULL,
37 NULL);
38 ok(hwnd != 0, "\n");
39
40 SetLastError(0xdeadbeef);
41 ok_hex(SetWindowWord(hwnd, 0, 0x1234), 0);
42 ok_hex(GetWindowWord(hwnd, 0), 0x1234);
43 ok_hex(SetWindowWord(hwnd, 1, 0x2345), 0x12);
44 ok_hex(GetWindowWord(hwnd, 1), 0x2345);
45 ok_hex(SetWindowWord(hwnd, 2, 0x3456), 0x23);
46 ok_hex(GetWindowWord(hwnd, 2), 0x3456);
47 ok_hex(SetWindowWord(hwnd, 3, 0x4567), 0x34);
48 ok_hex(GetWindowWord(hwnd, 3), 0x4567);
49 ok_err(0xdeadbeef);
50 ok_hex(SetWindowWord(hwnd, 4, 0x5678), 0);
52 SetLastError(0xdeadbeef);
55
56 SetLastError(0xdeadbeef);
57 ok_hex(SetWindowLong(hwnd, 0, 0x12345678), 0x67564534);
58 ok_hex(GetWindowLong(hwnd, 0), 0x12345678);
59 ok_hex(SetWindowLong(hwnd, 1, 0x23456789), 0x45123456);
60 ok_hex(GetWindowLong(hwnd, 1), 0x23456789);
61 ok_err(0xdeadbeef);
62 ok_hex(SetWindowLong(hwnd, 2, 0x3456789a), 0);
64 SetLastError(0xdeadbeef);
67
68#ifdef _WIN64
69 SetLastError(0xdeadbeef);
70 ok_hex(SetWindowLongPtr(hwnd, 0, 123), 0);
72 SetLastError(0xdeadbeef);
75#endif
76
77}
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok(value,...)
Definition: atltest.h:57
#define ok_err(error)
Definition: atltest.h:124
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define L(x)
Definition: ntvdm.h:50
#define WS_POPUP
Definition: pedump.c:616
LPCWSTR lpszClassName
Definition: winuser.h:3226
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
int cbWndExtra
Definition: winuser.h:3220
HINSTANCE hInstance
Definition: winuser.h:3221
UINT style
Definition: winuser.h:3217
int cbClsExtra
Definition: winuser.h:3219
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GetModuleHandle
Definition: winbase.h:3827
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define ERROR_INVALID_INDEX
Definition: winerror.h:894
#define SetWindowLong
Definition: winuser.h:5853
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WORD WINAPI SetWindowWord(_In_ HWND, _In_ int, _In_ WORD)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define GetWindowLong
Definition: winuser.h:5796
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
#define CW_USEDEFAULT
Definition: winuser.h:225
WORD WINAPI GetWindowWord(_In_ HWND, _In_ int)
struct _WNDCLASSEXW WNDCLASSEXW