ReactOS 0.4.17-dev-650-gd0e71de
dialog_initvisible.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Tests
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Tests whether a dialog is getting visible even if WM_INITDIALOG ends it.
5 * COPYRIGHT: Copyright 2026 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
6 */
7
8#define WIN32_NO_STATUS
9#include <windef.h>
10#include <winbase.h>
11#include <winuser.h>
12
13#define NTOS_MODE_USER
14#include <ndk/iotypes.h> // Needed for kdtypes.h
15#include <ndk/ketypes.h> // " " "
16#include <ndk/kdtypes.h> // For SharedUserData
17
18#include "resource.h"
19
22 _In_ HWND hDlg,
23 _In_ UINT uMsg,
26{
28 switch (uMsg)
29 {
30 case WM_INITDIALOG:
31 {
32 /* Intentional breakpoint for you to step-by-step debug into a debugger! */
33 if (IsDebuggerPresent() || SharedUserData->KdDebuggerEnabled)
35
37 EndDialog(hDlg, -1);
38 return (INT_PTR)TRUE;
39 }
40
41 case WM_COMMAND:
42 {
43 if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
44 {
45 EndDialog(hDlg, LOWORD(wParam));
46 return (INT_PTR)TRUE;
47 }
48 break;
49 }
50 }
51 return (INT_PTR)FALSE;
52}
53
54int APIENTRY
57 _In_ HINSTANCE hPrevInstance,
58 _In_ LPWSTR lpCmdLine,
59 _In_ int nCmdShow)
60{
61 UNREFERENCED_PARAMETER(hPrevInstance);
62 UNREFERENCED_PARAMETER(lpCmdLine);
63
65}
#define IDD_ABOUTBOX
Definition: resource.h:8
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
INT_PTR CALLBACK AboutDlgProc(_In_ HWND hDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APIENTRY
Definition: api.h:79
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI IsDebuggerPresent(void)
Definition: debug.c:167
unsigned int UINT
Definition: sysinfo.c:13
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
#define _In_
Definition: no_sal2.h:158
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define LOWORD(l)
Definition: pedump.c:82
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
#define SharedUserData
int32_t INT_PTR
Definition: typedefs.h:64
uint16_t * LPWSTR
Definition: typedefs.h:56
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
#define IDCANCEL
Definition: winuser.h:842
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4553
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_INITDIALOG
Definition: winuser.h:1767
#define IDOK
Definition: winuser.h:841
#define BN_CLICKED
Definition: winuser.h:1954
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)