ReactOS 0.4.16-dev-117-g38f21f9
GW_ENABLEDPOPUP.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: Test for GW_ENABLEDPOPUP
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "precomp.h"
9#include <windowsx.h>
10
11static HWND s_hwnd = NULL;
15
17{
18 HWND hwndRet;
19#define CHECK(hwndTarget) do { \
20 hwndRet = GetWindow(s_hwnd, GW_ENABLEDPOPUP); \
21 trace("hwndRet: %p\n", hwndRet); \
22 ok_int(hwndRet == hwndTarget, TRUE); \
23} while (0)
24
25 trace("%p, %p, %p, %p\n", s_hwnd, s_hwndChild1, s_hwndChild2, s_hwndChild3);
26
28
30
32
34
35 CHECK(NULL);
36
38
40
42
44
46
47 CHECK(NULL);
48
50
52
55
57
59
61
63
65}
66
67static LRESULT CALLBACK
69{
70 switch (uMsg)
71 {
72 case WM_CREATE:
73 SetTimer(hwnd, 999, 500, NULL);
74 break;
75 case WM_DESTROY:
76 if (s_hwnd == hwnd)
77 {
82 }
83 break;
84 case WM_TIMER:
86 if (wParam == 999 && hwnd == s_hwnd)
87 {
88 DoTestBody();
90 break;
91 }
92 break;
93 default:
94 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
95 }
96 return 0;
97}
98
100{
101 WNDCLASSW wc = { 0 };
102 MSG msg;
103
108 wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
109 wc.lpszClassName = L"GW_ENABLEDPOPUP";
110 if (!RegisterClassW(&wc))
111 {
112 skip("RegisterClass failed\n");
113 return;
114 }
115
116 s_hwnd = CreateWindowW(L"GW_ENABLEDPOPUP", L"GW_ENABLEDPOPUP",
118 0, 0, 100, 100,
119 NULL, NULL, wc.hInstance, NULL);
120 s_hwndChild1 = CreateWindowW(L"GW_ENABLEDPOPUP", L"Child #1",
122 100, 100, 100, 100,
123 s_hwnd, NULL, wc.hInstance, NULL);
124 s_hwndChild2 = CreateWindowW(L"GW_ENABLEDPOPUP", L"Child #2",
126 200, 200, 100, 100,
127 s_hwnd, NULL, wc.hInstance, NULL);
128 s_hwndChild3 = CreateWindowW(L"GW_ENABLEDPOPUP", L"Child #3",
130 300, 100, 100, 100,
133 {
134 skip("CreateWindow failed\n");
135 }
136
137 while (GetMessage(&msg, NULL, 0, 0))
138 {
141 }
142}
static HWND s_hwnd
static HWND s_hwndChild1
static VOID DoTestBody(VOID)
static HWND s_hwndChild2
static HWND s_hwndChild3
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define CHECK(hwndTarget)
#define trace
Definition: atltest.h:70
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_DISABLED
Definition: pedump.c:621
#define WS_POPUPWINDOW
Definition: pedump.c:638
LPCWSTR lpszClassName
Definition: winuser.h:3188
HBRUSH hbrBackground
Definition: winuser.h:3186
HICON hIcon
Definition: winuser.h:3184
HINSTANCE hInstance
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3180
HCURSOR hCursor
Definition: winuser.h:3185
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define SW_HIDE
Definition: winuser.h:771
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1611
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
#define SW_SHOWNOACTIVATE
Definition: winuser.h:777
#define GW_ENABLEDPOPUP
Definition: winuser.h:770
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IDI_APPLICATION
Definition: winuser.h:704
#define GetMessage
Definition: winuser.h:5802
#define WM_TIMER
Definition: winuser.h:1745
#define LoadIcon
Definition: winuser.h:5825
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LoadCursor
Definition: winuser.h:5824
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define COLOR_3DFACE
Definition: winuser.h:932