[SDK][UNDOCUSER] Add undocumented user32.dll SoftModalMessageBox() definition and...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 20 Feb 2018 22:07:11 +0000 (23:07 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 17 Aug 2018 15:12:20 +0000 (17:12 +0200)
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().

sdk/include/reactos/undocuser.h

index f130e6b..7001e98 100644 (file)
@@ -216,6 +216,83 @@ typedef struct _BALLOON_HARD_ERROR_DATA
     ULONG_PTR MessageOffset;
 } BALLOON_HARD_ERROR_DATA, *PBALLOON_HARD_ERROR_DATA;
 
+//
+// Undocumented SoftModalMessageBox() API, which constitutes
+// the basis of all implementations of the MessageBox*() APIs.
+//
+typedef struct _MSGBOXDATA
+{
+    MSGBOXPARAMSW mbp;          // Size: 0x28 (on x86), 0x50 (on x64)
+    HWND     hwndOwner;
+#if defined(_WIN32) && (_WIN32_WINNT >= _WIN32_WINNT_WIN7) /* (NTDDI_VERSION >= NTDDI_WIN7) */
+    DWORD    dwPadding;
+#endif
+    WORD     wLanguageId;
+    INT*     pidButton;         // Array of button IDs
+    LPCWSTR* ppszButtonText;    // Array of button text strings
+    DWORD    dwButtons;         // Number of buttons
+    UINT     uDefButton;        // Default button ID
+    UINT     uCancelId;         // Button ID for Cancel action
+#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)    /* (NTDDI_VERSION >= NTDDI_WINXP) */
+    DWORD    dwTimeout;         // Message box timeout
+#endif
+    DWORD    dwReserved0;
+#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)     /* (NTDDI_VERSION >= NTDDI_WIN7) */
+    DWORD    dwReserved[4];
+#endif
+} MSGBOXDATA, *PMSGBOXDATA, *LPMSGBOXDATA;
+
+#if defined(_WIN64)
+
+#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)     /* (NTDDI_VERSION >= NTDDI_WIN7) */
+C_ASSERT(sizeof(MSGBOXDATA) == 0x98);
+#elif (_WIN32_WINNT <= _WIN32_WINNT_WS03)   /* (NTDDI_VERSION <= NTDDI_WS03) */
+C_ASSERT(sizeof(MSGBOXDATA) == 0x88);
+#endif
+
+#else
+
+#if (_WIN32_WINNT <= _WIN32_WINNT_WIN2K)    /* (NTDDI_VERSION <= NTDDI_WIN2KSP4) */
+C_ASSERT(sizeof(MSGBOXDATA) == 0x48);
+#elif (_WIN32_WINNT >= _WIN32_WINNT_WIN7)   /* (NTDDI_VERSION >= NTDDI_WIN7) */
+C_ASSERT(sizeof(MSGBOXDATA) == 0x60);
+#else // (_WIN32_WINNT == _WIN32_WINNT_WINXP || _WIN32_WINNT == _WIN32_WINNT_WS03) /* (NTDDI_VERSION == NTDDI_WS03) */
+C_ASSERT(sizeof(MSGBOXDATA) == 0x4C);
+#endif
+
+#endif /* defined(_WIN64) */
+
+int WINAPI SoftModalMessageBox(IN LPMSGBOXDATA lpMsgBoxData);
+
+int
+WINAPI
+MessageBoxTimeoutA(
+    IN HWND hWnd,
+    IN LPCSTR lpText,
+    IN LPCSTR lpCaption,
+    IN UINT uType,
+    IN WORD wLanguageId,
+    IN DWORD dwTimeout);
+
+int
+WINAPI
+MessageBoxTimeoutW(
+    IN HWND hWnd,
+    IN LPCWSTR lpText,
+    IN LPCWSTR lpCaption,
+    IN UINT uType,
+    IN WORD wLanguageId,
+    IN DWORD dwTimeout);
+
+#ifdef UNICODE
+#define MessageBoxTimeout MessageBoxTimeoutW
+#else
+#define MessageBoxTimeout MessageBoxTimeoutA
+#endif
+
+LPCWSTR WINAPI MB_GetString(IN UINT wBtn);
+
+
 //
 // User api hook
 //