Skip to content

Commit ed1de71

Browse files
committed
[SDK][UNDOCUSER] Add undocumented user32.dll SoftModalMessageBox() definition and its structure MSGBOXDATA.
Documented on http://www.vbforums.com/showthread.php?840593-Message-Box-with-Four-Buttons and augmented from my own testings. In addition, add also MessageBoxTimeoutA/W() and MB_GetString().
1 parent 7bfd685 commit ed1de71

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

sdk/include/reactos/undocuser.h

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,83 @@ typedef struct _BALLOON_HARD_ERROR_DATA
216216
ULONG_PTR MessageOffset;
217217
} BALLOON_HARD_ERROR_DATA, *PBALLOON_HARD_ERROR_DATA;
218218

219+
//
220+
// Undocumented SoftModalMessageBox() API, which constitutes
221+
// the basis of all implementations of the MessageBox*() APIs.
222+
//
223+
typedef struct _MSGBOXDATA
224+
{
225+
MSGBOXPARAMSW mbp; // Size: 0x28 (on x86), 0x50 (on x64)
226+
HWND hwndOwner;
227+
#if defined(_WIN32) && (_WIN32_WINNT >= _WIN32_WINNT_WIN7) /* (NTDDI_VERSION >= NTDDI_WIN7) */
228+
DWORD dwPadding;
229+
#endif
230+
WORD wLanguageId;
231+
INT* pidButton; // Array of button IDs
232+
LPCWSTR* ppszButtonText; // Array of button text strings
233+
DWORD dwButtons; // Number of buttons
234+
UINT uDefButton; // Default button ID
235+
UINT uCancelId; // Button ID for Cancel action
236+
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP) /* (NTDDI_VERSION >= NTDDI_WINXP) */
237+
DWORD dwTimeout; // Message box timeout
238+
#endif
239+
DWORD dwReserved0;
240+
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) /* (NTDDI_VERSION >= NTDDI_WIN7) */
241+
DWORD dwReserved[4];
242+
#endif
243+
} MSGBOXDATA, *PMSGBOXDATA, *LPMSGBOXDATA;
244+
245+
#if defined(_WIN64)
246+
247+
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) /* (NTDDI_VERSION >= NTDDI_WIN7) */
248+
C_ASSERT(sizeof(MSGBOXDATA) == 0x98);
249+
#elif (_WIN32_WINNT <= _WIN32_WINNT_WS03) /* (NTDDI_VERSION <= NTDDI_WS03) */
250+
C_ASSERT(sizeof(MSGBOXDATA) == 0x88);
251+
#endif
252+
253+
#else
254+
255+
#if (_WIN32_WINNT <= _WIN32_WINNT_WIN2K) /* (NTDDI_VERSION <= NTDDI_WIN2KSP4) */
256+
C_ASSERT(sizeof(MSGBOXDATA) == 0x48);
257+
#elif (_WIN32_WINNT >= _WIN32_WINNT_WIN7) /* (NTDDI_VERSION >= NTDDI_WIN7) */
258+
C_ASSERT(sizeof(MSGBOXDATA) == 0x60);
259+
#else // (_WIN32_WINNT == _WIN32_WINNT_WINXP || _WIN32_WINNT == _WIN32_WINNT_WS03) /* (NTDDI_VERSION == NTDDI_WS03) */
260+
C_ASSERT(sizeof(MSGBOXDATA) == 0x4C);
261+
#endif
262+
263+
#endif /* defined(_WIN64) */
264+
265+
int WINAPI SoftModalMessageBox(IN LPMSGBOXDATA lpMsgBoxData);
266+
267+
int
268+
WINAPI
269+
MessageBoxTimeoutA(
270+
IN HWND hWnd,
271+
IN LPCSTR lpText,
272+
IN LPCSTR lpCaption,
273+
IN UINT uType,
274+
IN WORD wLanguageId,
275+
IN DWORD dwTimeout);
276+
277+
int
278+
WINAPI
279+
MessageBoxTimeoutW(
280+
IN HWND hWnd,
281+
IN LPCWSTR lpText,
282+
IN LPCWSTR lpCaption,
283+
IN UINT uType,
284+
IN WORD wLanguageId,
285+
IN DWORD dwTimeout);
286+
287+
#ifdef UNICODE
288+
#define MessageBoxTimeout MessageBoxTimeoutW
289+
#else
290+
#define MessageBoxTimeout MessageBoxTimeoutA
291+
#endif
292+
293+
LPCWSTR WINAPI MB_GetString(IN UINT wBtn);
294+
295+
219296
//
220297
// User api hook
221298
//

0 commit comments

Comments
 (0)