ReactOS 0.4.15-dev-7907-g95bf896
messagebox.c File Reference
#include <user32.h>
#include <ndk/exfuncs.h>
#include <ntstrsafe.h>
Include dependency graph for messagebox.c:

Go to the source code of this file.

Classes

struct  _MSGBTNINFO
 

Macros

#define MSGBOX_IDICON   (1088)
 
#define MSGBOX_IDTEXT   (0xffff)
 
#define IDI_HANDW   MAKEINTRESOURCEW(32513)
 
#define IDI_QUESTIONW   MAKEINTRESOURCEW(32514)
 
#define IDI_EXCLAMATIONW   MAKEINTRESOURCEW(32515)
 
#define IDI_ASTERISKW   MAKEINTRESOURCEW(32516)
 
#define IDI_WINLOGOW   MAKEINTRESOURCEW(32517)
 
#define BTN_CX   (75)
 
#define BTN_CY   (23)
 
#define MSGBOXEX_SPACING   (16)
 
#define MSGBOXEX_BUTTONSPACING   (6)
 
#define MSGBOXEX_MARGIN   (12)
 
#define MSGBOXEX_MAXBTNSTR   (32)
 
#define MSGBOXEX_MAXBTNS   (4)
 
#define RESCALE_X(_x, _units)   (((_x) * 4 + (_units).cx - 1) / (_units).cx)
 
#define RESCALE_Y(_y, _units)   (((_y) * 8 + (_units).cy - 1) / (_units).cy)
 
#define DECLARE_MB_1(_btn0)    { 1, { ID##_btn0, 0, 0 }, { IDS_##_btn0, 0, 0 } }
 
#define DECLARE_MB_2(_btn0, _btn1)    { 2, { ID##_btn0, ID##_btn1, 0 }, { IDS_##_btn0, IDS_##_btn1, 0 } }
 
#define DECLARE_MB_3(_btn0, _btn1, _btn2)    { 3, { ID##_btn0, ID##_btn1, ID##_btn2 }, { IDS_##_btn0, IDS_##_btn1, IDS_##_btn2 } }
 

Typedefs

typedef struct _MSGBTNINFO MSGBTNINFO
 
typedef struct _MSGBTNINFOPMSGBTNINFO
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
static UINT LoadAllocStringW (IN HINSTANCE hInstance OPTIONAL, IN UINT uID, OUT PWSTR *pString, IN PCWSTR pDefaultString OPTIONAL)
 
static VOID MessageBoxTextToClipboard (HWND DialogWindow)
 
static INT_PTR CALLBACK MessageBoxProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static int MessageBoxTimeoutIndirectW (CONST MSGBOXPARAMSW *lpMsgBoxParams, UINT dwTimeout)
 
int WINAPI SoftModalMessageBox (IN LPMSGBOXDATA lpMsgBoxData)
 
int WINAPI MessageBoxA (IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType)
 
int WINAPI MessageBoxW (IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType)
 
int WINAPI MessageBoxExA (IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
 
int WINAPI MessageBoxExW (IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
 
int WINAPI MessageBoxIndirectA (IN CONST MSGBOXPARAMSA *lpMsgBoxParams)
 
int WINAPI MessageBoxIndirectW (IN CONST MSGBOXPARAMSW *lpMsgBoxParams)
 
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)
 
BOOL WINAPI MessageBeep (IN UINT uType)
 
LPCWSTR WINAPI MB_GetString (IN UINT wBtn)
 

Variables

static const MSGBTNINFO MsgBtnInfo []
 

Macro Definition Documentation

◆ BTN_CX

#define BTN_CX   (75)

Definition at line 53 of file messagebox.c.

◆ BTN_CY

#define BTN_CY   (23)

Definition at line 54 of file messagebox.c.

◆ DECLARE_MB_1

#define DECLARE_MB_1 (   _btn0)     { 1, { ID##_btn0, 0, 0 }, { IDS_##_btn0, 0, 0 } }

Definition at line 69 of file messagebox.c.

◆ DECLARE_MB_2

#define DECLARE_MB_2 (   _btn0,
  _btn1 
)     { 2, { ID##_btn0, ID##_btn1, 0 }, { IDS_##_btn0, IDS_##_btn1, 0 } }

Definition at line 72 of file messagebox.c.

◆ DECLARE_MB_3

#define DECLARE_MB_3 (   _btn0,
  _btn1,
  _btn2 
)     { 3, { ID##_btn0, ID##_btn1, ID##_btn2 }, { IDS_##_btn0, IDS_##_btn1, IDS_##_btn2 } }

Definition at line 75 of file messagebox.c.

◆ IDI_ASTERISKW

#define IDI_ASTERISKW   MAKEINTRESOURCEW(32516)

Definition at line 47 of file messagebox.c.

◆ IDI_EXCLAMATIONW

#define IDI_EXCLAMATIONW   MAKEINTRESOURCEW(32515)

Definition at line 46 of file messagebox.c.

◆ IDI_HANDW

#define IDI_HANDW   MAKEINTRESOURCEW(32513)

Definition at line 44 of file messagebox.c.

◆ IDI_QUESTIONW

#define IDI_QUESTIONW   MAKEINTRESOURCEW(32514)

Definition at line 45 of file messagebox.c.

◆ IDI_WINLOGOW

#define IDI_WINLOGOW   MAKEINTRESOURCEW(32517)

Definition at line 48 of file messagebox.c.

◆ MSGBOX_IDICON

#define MSGBOX_IDICON   (1088)

Definition at line 41 of file messagebox.c.

◆ MSGBOX_IDTEXT

#define MSGBOX_IDTEXT   (0xffff)

Definition at line 42 of file messagebox.c.

◆ MSGBOXEX_BUTTONSPACING

#define MSGBOXEX_BUTTONSPACING   (6)

Definition at line 57 of file messagebox.c.

◆ MSGBOXEX_MARGIN

#define MSGBOXEX_MARGIN   (12)

Definition at line 58 of file messagebox.c.

◆ MSGBOXEX_MAXBTNS

#define MSGBOXEX_MAXBTNS   (4)

Definition at line 60 of file messagebox.c.

◆ MSGBOXEX_MAXBTNSTR

#define MSGBOXEX_MAXBTNSTR   (32)

Definition at line 59 of file messagebox.c.

◆ MSGBOXEX_SPACING

#define MSGBOXEX_SPACING   (16)

Definition at line 56 of file messagebox.c.

◆ RESCALE_X

#define RESCALE_X (   _x,
  _units 
)    (((_x) * 4 + (_units).cx - 1) / (_units).cx)

Definition at line 63 of file messagebox.c.

◆ RESCALE_Y

#define RESCALE_Y (   _y,
  _units 
)    (((_y) * 8 + (_units).cy - 1) / (_units).cy)

Definition at line 64 of file messagebox.c.

Typedef Documentation

◆ MSGBTNINFO

◆ PMSGBTNINFO

Function Documentation

◆ LoadAllocStringW()

static UINT LoadAllocStringW ( IN HINSTANCE hInstance  OPTIONAL,
IN UINT  uID,
OUT PWSTR pString,
IN PCWSTR pDefaultString  OPTIONAL 
)
static

Definition at line 108 of file messagebox.c.

113{
114 UINT Length;
115 PCWSTR pStr;
116
117 /* Try to load the string from the resource */
118 Length = LoadStringW(hInstance, uID, (LPWSTR)&pStr, 0);
119 if (Length == 0)
120 {
121 /* If the resource string was not found, use the fallback default one */
122
123 if (!pDefaultString)
124 {
125 /* None was specified, return NULL */
126 *pString = NULL;
127 return 0;
128 }
129
130 pStr = pDefaultString;
131 Length = wcslen(pStr);
132 }
133
134 /* Allocate a new buffer, adding a NULL-terminator */
135 *pString = RtlAllocateHeap(RtlGetProcessHeap(), 0, (Length + 1) * sizeof(WCHAR));
136 if (!*pString)
137 return 0;
138
139 /* Copy the string, NULL-terminated */
141 return Length;
142}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
HINSTANCE hInstance
Definition: charmap.c:19
#define NULL
Definition: types.h:112
FxString * pString
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
unsigned int UINT
Definition: ndis.h:50
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTRSAFEAPI RtlStringCchCopyNW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToCopy) STRSAFE_LPCWSTR pszSrc, _In_ size_t cchToCopy)
Definition: ntstrsafe.h:363
const uint16_t * PCWSTR
Definition: typedefs.h:57
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MessageBoxTimeoutIndirectW(), and SoftModalMessageBox().

◆ MB_GetString()

LPCWSTR WINAPI MB_GetString ( IN UINT  wBtn)

Definition at line 1345 of file messagebox.c.

1347{
1348 static BOOL bCached = FALSE;
1349 static MBSTRING MBStrings[MAX_MB_STRINGS]; // FIXME: Use gpsi->MBStrings when this is loaded by Win32k!
1350
1351 //
1352 // FIXME - TODO: The gpsi->MBStrings[] array should be loaded by win32k!
1353 //
1355 if (!bCached)
1356 {
1357 UINT i;
1358 for (i = 0; i < MAX_MB_STRINGS; ++i)
1359 {
1360 /*gpsi->*/MBStrings[i].uID = IDOK + i;
1361 /*gpsi->*/MBStrings[i].uStr = IDS_OK + i; // See user32/include/resource.h
1363 /*gpsi->*/MBStrings[i].uStr,
1364 /*gpsi->*/MBStrings[i].szName,
1365 ARRAYSIZE(/*gpsi->*/MBStrings[i].szName));
1366 }
1367 bCached = TRUE;
1368 }
1369
1370 /*
1371 * The allowable IDs are between "IDOK - 1" (0) and "IDCONTINUE - 1" (10) inclusive.
1372 * See psdk/winuser.h and user32/include/resource.h .
1373 */
1374 if (wBtn > IDCONTINUE - 1)
1375 return NULL;
1376
1377 return /*gpsi->*/MBStrings[wBtn].szName;
1378}
#define IDS_OK
Definition: resource.h:19
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define MAX_MB_STRINGS
Definition: ntuser.h:946
#define ASSERT(a)
Definition: mode.c:44
static const WCHAR szName[]
Definition: powrprof.c:45
UINT uStr
Definition: ntuser.h:979
UINT uID
Definition: ntuser.h:978
WCHAR szName[16]
Definition: ntuser.h:977
HINSTANCE User32Instance
Definition: dllmain.c:27
#define IDCONTINUE
Definition: vfdguiut.c:42
#define IDOK
Definition: winuser.h:830

Referenced by MessageBoxTimeoutIndirectW().

◆ MessageBeep()

BOOL WINAPI MessageBeep ( IN UINT  uType)

Definition at line 1329 of file messagebox.c.

1331{
1332 return NtUserxMessageBeep(uType);
1333}
EXTINLINE BOOL NtUserxMessageBeep(UINT uType)
Definition: ntwrapper.h:621

Referenced by SoftModalMessageBox().

◆ MessageBoxA()

int WINAPI MessageBoxA ( IN HWND  hWnd,
IN LPCSTR  lpText,
IN LPCSTR  lpCaption,
IN UINT  uType 
)

Definition at line 1074 of file messagebox.c.

1079{
1080 return MessageBoxExA(hWnd, lpText, lpCaption, uType, LANG_NEUTRAL);
1081}
HWND hWnd
Definition: settings.c:17
#define LANG_NEUTRAL
Definition: nls.h:22
int WINAPI MessageBoxExA(IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
Definition: messagebox.c:1103

◆ MessageBoxExA()

int WINAPI MessageBoxExA ( IN HWND  hWnd,
IN LPCSTR  lpText,
IN LPCSTR  lpCaption,
IN UINT  uType,
IN WORD  wLanguageId 
)

Definition at line 1103 of file messagebox.c.

1109{
1110 MSGBOXPARAMSA msgbox;
1111
1112 msgbox.cbSize = sizeof(msgbox);
1113 msgbox.hwndOwner = hWnd;
1114 msgbox.hInstance = 0;
1115 msgbox.lpszText = lpText;
1116 msgbox.lpszCaption = lpCaption;
1117 msgbox.dwStyle = uType;
1118 msgbox.lpszIcon = NULL;
1119 msgbox.dwContextHelpId = 0;
1120 msgbox.lpfnMsgBoxCallback = NULL;
1121 msgbox.dwLanguageId = wLanguageId;
1122
1123 return MessageBoxIndirectA(&msgbox);
1124}
DWORD dwLanguageId
Definition: winuser.h:3332
MSGBOXCALLBACK lpfnMsgBoxCallback
Definition: winuser.h:3331
DWORD_PTR dwContextHelpId
Definition: winuser.h:3330
DWORD dwStyle
Definition: winuser.h:3328
LPCSTR lpszIcon
Definition: winuser.h:3329
HINSTANCE hInstance
Definition: winuser.h:3325
LPCSTR lpszCaption
Definition: winuser.h:3327
HWND hwndOwner
Definition: winuser.h:3324
LPCSTR lpszText
Definition: winuser.h:3326
int WINAPI MessageBoxIndirectA(IN CONST MSGBOXPARAMSA *lpMsgBoxParams)
Definition: messagebox.c:1160

Referenced by MessageBoxA().

◆ MessageBoxExW()

int WINAPI MessageBoxExW ( IN HWND  hWnd,
IN LPCWSTR  lpText,
IN LPCWSTR  lpCaption,
IN UINT  uType,
IN WORD  wLanguageId 
)

Definition at line 1131 of file messagebox.c.

1137{
1138 MSGBOXPARAMSW msgbox;
1139
1140 msgbox.cbSize = sizeof(msgbox);
1141 msgbox.hwndOwner = hWnd;
1142 msgbox.hInstance = 0;
1143 msgbox.lpszText = lpText;
1144 msgbox.lpszCaption = lpCaption;
1145 msgbox.dwStyle = uType;
1146 msgbox.lpszIcon = NULL;
1147 msgbox.dwContextHelpId = 0;
1148 msgbox.lpfnMsgBoxCallback = NULL;
1149 msgbox.dwLanguageId = wLanguageId;
1150
1151 return MessageBoxTimeoutIndirectW(&msgbox, (UINT)-1);
1152}
DWORD dwLanguageId
Definition: winuser.h:3345
LPCWSTR lpszCaption
Definition: winuser.h:3340
DWORD_PTR dwContextHelpId
Definition: winuser.h:3343
HWND hwndOwner
Definition: winuser.h:3337
LPCWSTR lpszIcon
Definition: winuser.h:3342
MSGBOXCALLBACK lpfnMsgBoxCallback
Definition: winuser.h:3344
LPCWSTR lpszText
Definition: winuser.h:3339
HINSTANCE hInstance
Definition: winuser.h:3338
DWORD dwStyle
Definition: winuser.h:3341
static int MessageBoxTimeoutIndirectW(CONST MSGBOXPARAMSW *lpMsgBoxParams, UINT dwTimeout)
Definition: messagebox.c:449

Referenced by MessageBoxW().

◆ MessageBoxIndirectA()

int WINAPI MessageBoxIndirectA ( IN CONST MSGBOXPARAMSA lpMsgBoxParams)

Definition at line 1160 of file messagebox.c.

1162{
1163 MSGBOXPARAMSW msgboxW;
1164 UNICODE_STRING textW, captionW, iconW;
1165 int ret;
1166
1167 if (!IS_INTRESOURCE(lpMsgBoxParams->lpszText))
1168 {
1169 RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpMsgBoxParams->lpszText);
1170 /*
1171 * UNICODE_STRING objects are always allocated with an extra byte so you
1172 * can null-term if you want
1173 */
1174 textW.Buffer[textW.Length / sizeof(WCHAR)] = L'\0';
1175 }
1176 else
1177 textW.Buffer = (LPWSTR)lpMsgBoxParams->lpszText;
1178
1179 if (!IS_INTRESOURCE(lpMsgBoxParams->lpszCaption))
1180 {
1181 RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpMsgBoxParams->lpszCaption);
1182 /*
1183 * UNICODE_STRING objects are always allocated with an extra byte so you
1184 * can null-term if you want
1185 */
1186 captionW.Buffer[captionW.Length / sizeof(WCHAR)] = L'\0';
1187 }
1188 else
1189 captionW.Buffer = (LPWSTR)lpMsgBoxParams->lpszCaption;
1190
1191 if (lpMsgBoxParams->dwStyle & MB_USERICON)
1192 {
1193 if (!IS_INTRESOURCE(lpMsgBoxParams->lpszIcon))
1194 {
1195 RtlCreateUnicodeStringFromAsciiz(&iconW, (PCSZ)lpMsgBoxParams->lpszIcon);
1196 /*
1197 * UNICODE_STRING objects are always allocated with an extra byte so you
1198 * can null-term if you want
1199 */
1200 iconW.Buffer[iconW.Length / sizeof(WCHAR)] = L'\0';
1201 }
1202 else
1203 iconW.Buffer = (LPWSTR)lpMsgBoxParams->lpszIcon;
1204 }
1205 else
1206 iconW.Buffer = NULL;
1207
1208 msgboxW.cbSize = sizeof(msgboxW);
1209 msgboxW.hwndOwner = lpMsgBoxParams->hwndOwner;
1210 msgboxW.hInstance = lpMsgBoxParams->hInstance;
1211 msgboxW.lpszText = textW.Buffer;
1212 msgboxW.lpszCaption = captionW.Buffer;
1213 msgboxW.dwStyle = lpMsgBoxParams->dwStyle;
1214 msgboxW.lpszIcon = iconW.Buffer;
1215 msgboxW.dwContextHelpId = lpMsgBoxParams->dwContextHelpId;
1216 msgboxW.lpfnMsgBoxCallback = lpMsgBoxParams->lpfnMsgBoxCallback;
1217 msgboxW.dwLanguageId = lpMsgBoxParams->dwLanguageId;
1218
1219 ret = MessageBoxTimeoutIndirectW(&msgboxW, (UINT)-1);
1220
1221 if (!IS_INTRESOURCE(lpMsgBoxParams->lpszText))
1223
1224 if (!IS_INTRESOURCE(lpMsgBoxParams->lpszCaption))
1225 RtlFreeUnicodeString(&captionW);
1226
1227 if ((lpMsgBoxParams->dwStyle & MB_USERICON) && !IS_INTRESOURCE(iconW.Buffer))
1229
1230 return ret;
1231}
static const WCHAR iconW[]
Definition: sec_mgr.c:42
if(dx< 0)
Definition: linetemp.h:194
static const WCHAR textW[]
Definition: itemdlg.c:1559
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define L(x)
Definition: ntvdm.h:50
CONST char * PCSZ
Definition: umtypes.h:125
int ret
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define MB_USERICON
Definition: winuser.h:783

Referenced by MessageBoxExA().

◆ MessageBoxIndirectW()

int WINAPI MessageBoxIndirectW ( IN CONST MSGBOXPARAMSW lpMsgBoxParams)

Definition at line 1238 of file messagebox.c.

1240{
1241 return MessageBoxTimeoutIndirectW(lpMsgBoxParams, (UINT)-1);
1242}

◆ MessageBoxProc()

static INT_PTR CALLBACK MessageBoxProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 248 of file messagebox.c.

251{
252 PMSGBOXDATA mbd;
253
254 switch (message)
255 {
256 case WM_INITDIALOG:
257 {
258 int Alert;
259
260 mbd = (PMSGBOXDATA)lParam;
261
264
265 if (!GetPropW(hwnd, L"ROS_MSGBOX"))
266 {
267 SetPropW(hwnd, L"ROS_MSGBOX", (HANDLE)lParam);
268
269 if (mbd->mbp.dwContextHelpId)
271
272 if (mbd->mbp.lpszIcon)
273 {
275 Alert = ALERT_SYSTEM_WARNING;
276 }
277 else /* Setup the rest of the alerts */
278 {
279 switch (mbd->mbp.dwStyle & MB_ICONMASK)
280 {
281 case MB_ICONWARNING:
282 Alert = ALERT_SYSTEM_WARNING;
283 break;
284 case MB_ICONERROR:
285 Alert = ALERT_SYSTEM_ERROR;
286 break;
287 case MB_ICONQUESTION:
288 Alert = ALERT_SYSTEM_QUERY;
289 break;
290 default:
291 Alert = ALERT_SYSTEM_INFORMATIONAL;
292 /* Fall through */
293 }
294 }
295 /* Send out the alert notifications */
296 NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd, OBJID_ALERT, Alert);
297
298 /* Disable the Close menu button if no Cancel button is specified */
299 if (mbd->uCancelId == 0)
300 {
301 HMENU hSysMenu = GetSystemMenu(hwnd, FALSE);
302 if (hSysMenu)
303 DeleteMenu(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
304 }
305
306 /* Set the focus to the default button */
307 if (mbd->dwButtons > 0)
308 {
309 ASSERT(mbd->uDefButton < mbd->dwButtons);
311 }
312
313 /* Set up the window timer */
314 if (mbd->dwTimeout && (mbd->dwTimeout != (UINT)-1))
315 SetTimer(hwnd, 0, mbd->dwTimeout, NULL);
316 }
317 return FALSE;
318 }
319
320 case WM_COMMAND:
321 {
322 UINT i;
323 INT_PTR iCtrlId = LOWORD(wParam);
324
325 switch (iCtrlId)
326 {
327 /* Handle the default message-box buttons */
328 case IDOK:
329 case IDCANCEL:
330 /*
331 * The dialog manager always sends IDCANCEL when the user
332 * presses ESCape. We check here whether the message box
333 * has a CANCEL button, or whether we should fall back to
334 * the OK button, by using the correct uCancelId.
335 */
336 if (iCtrlId == IDCANCEL)
337 {
338 mbd = (PMSGBOXDATA)GetPropW(hwnd, L"ROS_MSGBOX");
339 if (!mbd)
340 return FALSE; /* Ignore */
341
342 /* Check whether we can cancel the message box */
343 if (mbd->uCancelId == 0)
344 return TRUE; // FALSE; /* No, ignore */
345 /* Quit with the correct return value */
346 iCtrlId = mbd->uCancelId;
347 }
348 if (!GetDlgItem(hwnd, iCtrlId))
349 return FALSE; /* Ignore */
350
351 /* Fall through */
352 case IDABORT:
353 case IDRETRY:
354 case IDIGNORE:
355 case IDYES:
356 case IDNO:
357 case IDTRYAGAIN:
358 case IDCONTINUE:
359 EndDialog(hwnd, iCtrlId);
360 return TRUE;
361
362 case IDCLOSE:
363 return FALSE; /* Ignore */
364
365 case IDHELP:
366 {
367 /* Send WM_HELP message to the message-box window */
368 HELPINFO hi;
369 hi.cbSize = sizeof(hi);
371 hi.iCtrlId = iCtrlId;
373 hi.dwContextId = 0;
375 SendMessageW(hwnd, WM_HELP, 0, (LPARAM)&hi);
376 return TRUE;
377 }
378
379 default:
380 break;
381 }
382
383 /* Check for any other user-defined buttons */
384 mbd = (PMSGBOXDATA)GetPropW(hwnd, L"ROS_MSGBOX");
385 if (!mbd)
386 return FALSE;
387
388 for (i = 0; i < mbd->dwButtons; ++i)
389 {
390 if (iCtrlId == mbd->pidButton[i])
391 {
392 EndDialog(hwnd, iCtrlId);
393 return TRUE;
394 }
395 }
396
397 return FALSE;
398 }
399
400 case WM_COPY:
402 return TRUE;
403
404 case WM_HELP:
405 {
407 mbd = (PMSGBOXDATA)GetPropW(hwnd, L"ROS_MSGBOX");
408 if (!mbd)
409 return FALSE;
411
412 if (mbd->mbp.lpfnMsgBoxCallback)
413 {
414 mbd->mbp.lpfnMsgBoxCallback(phi);
415 }
416 else
417 {
418 HWND hwndOwner = GetWindow(hwnd, GW_OWNER);
419 if (hwndOwner)
420 SendMessageW(hwndOwner, WM_HELP, 0, lParam);
421 }
422 return TRUE;
423 }
424
425 case WM_CLOSE:
426 {
427 mbd = (PMSGBOXDATA)GetPropW(hwnd, L"ROS_MSGBOX");
428 if (!mbd)
429 return FALSE;
430
431 /* Check whether we can cancel the message box */
432 if (mbd->uCancelId == 0)
433 return TRUE; /* No, ignore */
434 /* Quit with the correct return value */
435 EndDialog(hwnd, mbd->uCancelId);
436 return TRUE;
437 }
438
439 case WM_TIMER:
440 if (wParam == 0)
442 return FALSE;
443 }
444
445 return FALSE;
446}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct _MSGBOXDATA * PMSGBOXDATA
static HICON
Definition: imagelist.c:84
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
EXTINLINE BOOL NtUserxSetMessageBox(HWND hWnd)
Definition: ntwrapper.h:741
#define LOWORD(l)
Definition: pedump.c:82
#define IDHELP
Definition: resource_2.h:8
DWORD dwButtons
Definition: messagebox.c:33
UINT uCancelId
Definition: messagebox.c:35
INT * pidButton
Definition: messagebox.c:31
DWORD dwTimeout
Definition: messagebox.c:37
UINT uDefButton
Definition: messagebox.c:34
MSGBOXPARAMSW mbp
Definition: messagebox.c:25
Definition: tftpd.h:60
POINT MousePos
Definition: winuser.h:3317
int iCtrlId
Definition: winuser.h:3314
DWORD_PTR dwContextId
Definition: winuser.h:3316
HANDLE hItemHandle
Definition: winuser.h:3315
int iContextType
Definition: winuser.h:3313
UINT cbSize
Definition: winuser.h:3312
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT_PTR
Definition: typedefs.h:64
PVOID HANDLE
Definition: typedefs.h:73
#define IDTRYAGAIN
Definition: vfdguiut.c:38
static VOID MessageBoxTextToClipboard(HWND DialogWindow)
Definition: messagebox.c:144
#define MSGBOX_IDICON
Definition: messagebox.c:41
#define OBJID_ALERT
Definition: winable.h:25
void WINAPI NotifyWinEvent(DWORD, HWND, LONG, LONG)
Definition: hook.c:325
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define GW_OWNER
Definition: winuser.h:766
#define WM_CLOSE
Definition: winuser.h:1621
#define MF_BYCOMMAND
Definition: winuser.h:202
#define STM_SETICON
Definition: winuser.h:2092
struct tagHELPINFO * LPHELPINFO
#define IDCANCEL
Definition: winuser.h:831
BOOL WINAPI SetWindowContextHelpId(_In_ HWND, _In_ DWORD)
#define WM_COMMAND
Definition: winuser.h:1740
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2670
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define WM_INITDIALOG
Definition: winuser.h:1739
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
DWORD WINAPI GetWindowContextHelpId(_In_ HWND)
#define MB_ICONMASK
Definition: winuser.h:819
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IDIGNORE
Definition: winuser.h:834
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_ICONERROR
Definition: winuser.h:787
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_TIMER
Definition: winuser.h:1742
#define IDNO
Definition: winuser.h:836
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define SC_CLOSE
Definition: winuser.h:2592
#define IDABORT
Definition: winuser.h:832
#define MB_ICONWARNING
Definition: winuser.h:786
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define MB_ICONQUESTION
Definition: winuser.h:789
#define WM_COPY
Definition: winuser.h:1862
#define IDYES
Definition: winuser.h:835
#define IDRETRY
Definition: winuser.h:833
#define SetWindowLongPtrW
Definition: winuser.h:5346
#define HELPINFO_WINDOW
Definition: winuser.h:1172
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define IDTIMEOUT
Definition: wtsapi32.h:31

Referenced by SoftModalMessageBox().

◆ MessageBoxTextToClipboard()

static VOID MessageBoxTextToClipboard ( HWND  DialogWindow)
static

Definition at line 144 of file messagebox.c.

145{
146 HWND hwndText;
147 PMSGBOXDATA mbd;
148 int cchTotal, cchTitle, cchText, cchButton, i, n, cchBuffer;
149 LPWSTR pszBuffer, pszBufferPos, pMessageBoxText, pszTitle, pszText, pszButton;
150 WCHAR szButton[MSGBOXEX_MAXBTNSTR];
151 HGLOBAL hGlobal;
152
153 static const WCHAR szLine[] = L"---------------------------\r\n";
154
155 mbd = (PMSGBOXDATA)GetPropW(DialogWindow, L"ROS_MSGBOX");
157 cchTitle = GetWindowTextLengthW(DialogWindow) + 1;
158 cchText = GetWindowTextLengthW(hwndText) + 1;
159
160 if (!mbd)
161 return;
162
163 pMessageBoxText = (LPWSTR)RtlAllocateHeap(GetProcessHeap(), 0, (cchTitle + cchText) * sizeof(WCHAR));
164
165 if (pMessageBoxText == NULL)
166 {
167 RtlFreeHeap(GetProcessHeap(), 0, pMessageBoxText);
168 return;
169 }
170
171 pszTitle = pMessageBoxText;
172 pszText = pMessageBoxText + cchTitle;
173
174 if (GetWindowTextW(DialogWindow, pszTitle, cchTitle) == 0 ||
175 GetWindowTextW(hwndText, pszText, cchText) == 0)
176 {
177 RtlFreeHeap(GetProcessHeap(), 0, pMessageBoxText);
178 return;
179 }
180
181 /*
182 * Calculate the total buffer size.
183 */
184 cchTotal = 6 + cchTitle + cchText + (lstrlenW(szLine) * 4) + (mbd->dwButtons * MSGBOXEX_MAXBTNSTR + 3);
185
186 hGlobal = GlobalAlloc(GHND, cchTotal * sizeof(WCHAR));
187
188 pszBuffer = (LPWSTR)GlobalLock(hGlobal);
189
190 if (pszBuffer == NULL)
191 {
192 RtlFreeHeap(GetProcessHeap(), 0, pMessageBoxText);
193 GlobalFree(hGlobal);
194 return;
195 }
196
197 /*
198 * First format title and text.
199 * ------------------
200 * Title
201 * ------------------
202 * Text
203 * ------------------
204 */
205 cchBuffer = wsprintfW(pszBuffer, L"%s%s\r\n%s%s\r\n%s", szLine, pszTitle, szLine, pszText, szLine);
206 pszBufferPos = pszBuffer + cchBuffer;
207
208 for (i = 0; i < mbd->dwButtons; i++)
209 {
211
212 cchButton = strlenW(szButton);
213 pszButton = szButton;
214
215 /* Skip '&' character. */
216 if (szButton[0] == '&')
217 {
218 pszButton = pszButton + 1;
219 cchButton = cchButton - 1;
220 }
221
222 for (n = 0; n < cchButton; n++)
223 *(pszBufferPos++) = pszButton[n];
224
225 /* Add spaces. */
226 *(pszBufferPos++) = L' ';
227 *(pszBufferPos++) = L' ';
228 *(pszBufferPos++) = L' ';
229 }
230
231 wsprintfW(pszBufferPos, L"\r\n%s", szLine);
232
233 GlobalUnlock(hGlobal);
234
236 {
240 }
241 else
242 {
243 GlobalFree(hGlobal);
244 }
245 RtlFreeHeap(GetProcessHeap(), 0, pMessageBoxText);
246}
#define CF_UNICODETEXT
Definition: constants.h:408
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define GetProcessHeap()
Definition: compat.h:736
#define lstrlenW
Definition: compat.h:750
static DWORD cchBuffer
Definition: fusion.c:85
GLdouble n
Definition: glext.h:7729
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define strlenW(s)
Definition: unicode.h:28
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define MSGBOX_IDTEXT
Definition: messagebox.c:42
#define MSGBOXEX_MAXBTNSTR
Definition: messagebox.c:59
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define GHND
Definition: winbase.h:297
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
_In_ int cchText
Definition: winuser.h:4465
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
int WINAPI GetWindowTextLengthW(_In_ HWND)

Referenced by MessageBoxProc().

◆ MessageBoxTimeoutA()

int WINAPI MessageBoxTimeoutA ( IN HWND  hWnd,
IN LPCSTR  lpText,
IN LPCSTR  lpCaption,
IN UINT  uType,
IN WORD  wLanguageId,
IN DWORD  dwTimeout 
)

Definition at line 1250 of file messagebox.c.

1257{
1258 MSGBOXPARAMSW msgboxW;
1259 UNICODE_STRING textW, captionW;
1260 int ret;
1261
1262 if (!IS_INTRESOURCE(lpText))
1264 else
1265 textW.Buffer = (LPWSTR)lpText;
1266
1267 if (!IS_INTRESOURCE(lpCaption))
1268 RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpCaption);
1269 else
1270 captionW.Buffer = (LPWSTR)lpCaption;
1271
1272 msgboxW.cbSize = sizeof(msgboxW);
1273 msgboxW.hwndOwner = hWnd;
1274 msgboxW.hInstance = 0;
1275 msgboxW.lpszText = textW.Buffer;
1276 msgboxW.lpszCaption = captionW.Buffer;
1277 msgboxW.dwStyle = uType;
1278 msgboxW.lpszIcon = NULL;
1279 msgboxW.dwContextHelpId = 0;
1280 msgboxW.lpfnMsgBoxCallback = NULL;
1281 msgboxW.dwLanguageId = wLanguageId;
1282
1284
1285 if (!IS_INTRESOURCE(textW.Buffer))
1287
1288 if (!IS_INTRESOURCE(captionW.Buffer))
1289 RtlFreeUnicodeString(&captionW);
1290
1291 return ret;
1292}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
Definition: wincrypt.h:6081

◆ MessageBoxTimeoutIndirectW()

static int MessageBoxTimeoutIndirectW ( CONST MSGBOXPARAMSW lpMsgBoxParams,
UINT  dwTimeout 
)
static

Definition at line 449 of file messagebox.c.

451{
452 int ret = 0;
453 UINT i;
454 LPWSTR defCaption = NULL;
455 MSGBOXDATA mbd;
457 LPCWSTR ButtonText[MSGBOXEX_MAXBTNS];
458
459 // TODO: Check whether the caller is an NT 3.x app and if so, check
460 // instead for the MB_SERVICE_NOTIFICATION_NT3X flag and adjust it.
461 if (lpMsgBoxParams->dwStyle & MB_SERVICE_NOTIFICATION)
462 {
464 UNICODE_STRING CaptionU, TextU;
465 ULONG Response = ResponseNotHandled; /* HARDERROR_RESPONSE */
466 ULONG_PTR MsgBoxParams[4] =
467 {
468 (ULONG_PTR)&TextU,
469 (ULONG_PTR)&CaptionU,
470 /*
471 * Retrieve the message box flags. Note that we filter out
472 * MB_SERVICE_NOTIFICATION to not enter an infinite recursive
473 * loop when we will call MessageBox() later on.
474 */
475 lpMsgBoxParams->dwStyle & ~MB_SERVICE_NOTIFICATION,
477 };
478
479 /* hwndOwner must be NULL */
480 if (lpMsgBoxParams->hwndOwner != NULL)
481 {
482 ERR("MessageBoxTimeoutIndirectW(MB_SERVICE_NOTIFICATION): hwndOwner is not NULL!\n");
483 return 0;
484 }
485
486 //
487 // FIXME: TODO: Implement the special case for Terminal Services.
488 //
489
490 RtlInitUnicodeString(&CaptionU, lpMsgBoxParams->lpszCaption);
491 RtlInitUnicodeString(&TextU, lpMsgBoxParams->lpszText);
492
494 ARRAYSIZE(MsgBoxParams),
495 (1 | 2),
496 MsgBoxParams,
497 OptionOk, /* NOTE: This parameter is ignored */
498 &Response);
499 if (!NT_SUCCESS(Status))
500 {
501 ERR("MessageBoxTimeoutIndirectW(MB_SERVICE_NOTIFICATION): NtRaiseHardError failed, Status = 0x%08lx\n", Status);
502 return 0;
503 }
504
505 /* Map the returned response to the buttons */
506 switch (Response)
507 {
508 /* Not handled */
511 break;
512
513 case ResponseAbort:
514 return IDABORT;
515 case ResponseCancel:
516 return IDCANCEL;
517 case ResponseIgnore:
518 return IDIGNORE;
519 case ResponseNo:
520 return IDNO;
521 case ResponseOk:
522 return IDOK;
523 case ResponseRetry:
524 return IDRETRY;
525 case ResponseYes:
526 return IDYES;
527 case ResponseTryAgain:
528 return IDTRYAGAIN;
529 case ResponseContinue:
530 return IDCONTINUE;
531
532 /* Not handled */
533 default:
534 break;
535 }
536 return 0;
537 }
538
539 ZeroMemory(&mbd, sizeof(mbd));
540 memcpy(&mbd.mbp, lpMsgBoxParams, sizeof(mbd.mbp));
541 mbd.wLanguageId = (WORD)lpMsgBoxParams->dwLanguageId;
542 mbd.dwTimeout = dwTimeout;
543
544 if (!mbd.mbp.lpszCaption)
545 {
546 /* No caption, use the default one */
548 IDS_ERROR,
549 &defCaption,
550 L"Error");
551 mbd.mbp.lpszCaption = (defCaption ? defCaption : L"Error");
552 }
553
554 /* Create the selected buttons; unknown types will fall back to MB_OK */
555 i = (lpMsgBoxParams->dwStyle & MB_TYPEMASK);
556 if (i >= ARRAYSIZE(MsgBtnInfo))
557 i = MB_OK;
558
559 /* Get the buttons IDs */
561
562 /* Add the Help button */
563 if (lpMsgBoxParams->dwStyle & MB_HELP)
564 {
565 Buttons.btnIdx[Buttons.btnCnt] = IDHELP;
566 Buttons.btnIds[Buttons.btnCnt] = IDS_HELP;
567 Buttons.btnCnt++;
568 }
569
571
572 /* Retrieve the pointers to the button labels and find the Cancel button */
573 mbd.uCancelId = (i == MB_OK ? IDOK : 0);
574 for (i = 0; i < Buttons.btnCnt; ++i)
575 {
576 // FIXME: Use the strings in the correct language.
577 // MB_GetString gives the string in default system language.
578 ButtonText[i] = MB_GetString(Buttons.btnIds[i] - IDS_OK); /* or: Buttons.btnIdx[i] - IDOK */
579#if 0
581 Buttons.btnIds[i],
582 &ButtonText[i],
583 L"");
584#endif
585 if (Buttons.btnIdx[i] == IDCANCEL)
586 mbd.uCancelId = IDCANCEL;
587 }
588
589 mbd.pidButton = Buttons.btnIdx;
590 mbd.ppszButtonText = ButtonText;
591 mbd.dwButtons = Buttons.btnCnt;
592
593 mbd.uDefButton = ((lpMsgBoxParams->dwStyle & MB_DEFMASK) >> 8);
594 /* Make the first button the default button if none other is */
595 if (mbd.uDefButton >= mbd.dwButtons)
596 mbd.uDefButton = 0;
597
598 /* Call the helper function */
599 ret = SoftModalMessageBox(&mbd);
600
601#if 0
602 for (i = 0; i < mbd.dwButtons; i++)
603 {
604 if (ButtonText[i] && *ButtonText[i])
605 RtlFreeHeap(RtlGetProcessHeap(), 0, ButtonText[i]);
606 }
607#endif
608
609 if (defCaption)
610 RtlFreeHeap(RtlGetProcessHeap(), 0, defCaption);
611
612 return ret;
613}
#define IDS_HELP
Definition: resource.h:3
#define IDS_ERROR
Definition: resource.h:18
LONG NTSTATUS
Definition: precomp.h:26
#define ERR(fmt,...)
Definition: debug.h:110
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ULONG_PTR
Definition: config.h:101
unsigned short WORD
Definition: ntddk_ex.h:93
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:551
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const TBBUTTON Buttons[]
Definition: mplay32.c:41
#define HARDERROR_OVERRIDE_ERRORMODE
Definition: extypes.h:146
@ OptionOk
Definition: extypes.h:187
@ ResponseNo
Definition: extypes.h:204
@ ResponseNotHandled
Definition: extypes.h:200
@ ResponseTryAgain
Definition: extypes.h:208
@ ResponseOk
Definition: extypes.h:205
@ ResponseRetry
Definition: extypes.h:206
@ ResponseReturnToCaller
Definition: extypes.h:199
@ ResponseIgnore
Definition: extypes.h:203
@ ResponseCancel
Definition: extypes.h:202
@ ResponseYes
Definition: extypes.h:207
@ ResponseAbort
Definition: extypes.h:201
@ ResponseContinue
Definition: extypes.h:209
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define STATUS_SERVICE_NOTIFICATION
Definition: ntstatus.h:138
Definition: ncftp.h:89
WORD wLanguageId
Definition: messagebox.c:30
LPCWSTR * ppszButtonText
Definition: messagebox.c:32
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
int WINAPI SoftModalMessageBox(IN LPMSGBOXDATA lpMsgBoxData)
Definition: messagebox.c:617
static UINT LoadAllocStringW(IN HINSTANCE hInstance OPTIONAL, IN UINT uID, OUT PWSTR *pString, IN PCWSTR pDefaultString OPTIONAL)
Definition: messagebox.c:108
static const MSGBTNINFO MsgBtnInfo[]
Definition: messagebox.c:86
LPCWSTR WINAPI MB_GetString(IN UINT wBtn)
Definition: messagebox.c:1345
#define MSGBOXEX_MAXBTNS
Definition: messagebox.c:60
#define ZeroMemory
Definition: winbase.h:1712
#define MB_HELP
Definition: winuser.h:794
#define MB_DEFMASK
Definition: winuser.h:820
#define MB_OK
Definition: winuser.h:790
#define MB_TYPEMASK
Definition: winuser.h:824
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by MessageBoxExW(), MessageBoxIndirectA(), MessageBoxIndirectW(), MessageBoxTimeoutA(), and MessageBoxTimeoutW().

◆ MessageBoxTimeoutW()

int WINAPI MessageBoxTimeoutW ( IN HWND  hWnd,
IN LPCWSTR  lpText,
IN LPCWSTR  lpCaption,
IN UINT  uType,
IN WORD  wLanguageId,
IN DWORD  dwTimeout 
)

Definition at line 1299 of file messagebox.c.

1306{
1307 MSGBOXPARAMSW msgbox;
1308
1309 msgbox.cbSize = sizeof(msgbox);
1310 msgbox.hwndOwner = hWnd;
1311 msgbox.hInstance = 0;
1312 msgbox.lpszText = lpText;
1313 msgbox.lpszCaption = lpCaption;
1314 msgbox.dwStyle = uType;
1315 msgbox.lpszIcon = NULL;
1316 msgbox.dwContextHelpId = 0;
1317 msgbox.lpfnMsgBoxCallback = NULL;
1318 msgbox.dwLanguageId = wLanguageId;
1319
1320 return MessageBoxTimeoutIndirectW(&msgbox, (UINT)dwTimeout);
1321}

◆ MessageBoxW()

int WINAPI MessageBoxW ( IN HWND  hWnd,
IN LPCWSTR  lpText,
IN LPCWSTR  lpCaption,
IN UINT  uType 
)

Definition at line 1088 of file messagebox.c.

1093{
1094 return MessageBoxExW(hWnd, lpText, lpCaption, uType, LANG_NEUTRAL);
1095}
int WINAPI MessageBoxExW(IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
Definition: messagebox.c:1131

◆ SoftModalMessageBox()

int WINAPI SoftModalMessageBox ( IN LPMSGBOXDATA  lpMsgBoxData)

Definition at line 617 of file messagebox.c.

618{
619 int ret = 0;
620 MSGBOXDATA mbd;
621 LPMSGBOXPARAMSW lpMsgBoxParams = &mbd.mbp;
622 DLGTEMPLATE *tpl;
623 DLGITEMTEMPLATE *iico, *itxt, *ibtn;
624 NONCLIENTMETRICSW nclm;
625 LPVOID buf;
626 BYTE *dest;
627 LPWSTR caption, text;
628 HFONT hFont, hOldFont;
629 HICON hIcon;
630 HWND hDCWnd;
631 HDC hDC;
632 SIZE units;
633 int bufsize, caplen, textlen, i, btnleft, btntop;
634 size_t ButtonLen;
635 RECT btnrect, txtrect, rc;
636 SIZE btnsize;
637 POINT iconPos; SIZE iconSize;
638
639 /* Capture the MsgBoxData */
640 memcpy(&mbd, lpMsgBoxData, sizeof(mbd));
641
642 /* Load the caption */
643 caption = NULL;
644 if (lpMsgBoxParams->lpszCaption && IS_INTRESOURCE(lpMsgBoxParams->lpszCaption))
645 {
646 /* User-defined resource string */
647 caplen = LoadAllocStringW(lpMsgBoxParams->hInstance,
648 PtrToUlong(lpMsgBoxParams->lpszCaption),
649 &caption,
650 NULL);
651 lpMsgBoxParams->lpszCaption = caption;
652 }
653 else if (lpMsgBoxParams->lpszCaption)
654 {
655 /* UNICODE string pointer */
656 caplen = wcslen(lpMsgBoxParams->lpszCaption);
657 }
658 if (!lpMsgBoxParams->lpszCaption)
659 {
660 /* No caption, use blank */
661 lpMsgBoxParams->lpszCaption = L"";
662 caplen = 0;
663 }
664
665 /* Load the text */
666 text = NULL;
667 if (lpMsgBoxParams->lpszText && IS_INTRESOURCE(lpMsgBoxParams->lpszText))
668 {
669 /* User-defined resource string */
670 textlen = LoadAllocStringW(lpMsgBoxParams->hInstance,
671 PtrToUlong(lpMsgBoxParams->lpszText),
672 &text,
673 NULL);
674 lpMsgBoxParams->lpszText = text;
675 }
676 else if (lpMsgBoxParams->lpszText)
677 {
678 /* UNICODE string pointer */
679 textlen = wcslen(lpMsgBoxParams->lpszText);
680 }
681 if (!lpMsgBoxParams->lpszText)
682 {
683 /* No text, use blank */
684 lpMsgBoxParams->lpszText = L"";
685 textlen = 0;
686 }
687
688 /* Load the icon */
689 switch (lpMsgBoxParams->dwStyle & MB_ICONMASK)
690 {
691 case MB_ICONEXCLAMATION: // case MB_ICONWARNING:
694 break;
695 case MB_ICONQUESTION:
698 break;
699 case MB_ICONASTERISK: // case MB_ICONINFORMATION:
702 break;
703 case MB_ICONHAND: // case MB_ICONSTOP: case MB_ICONERROR:
706 break;
707 case MB_USERICON:
708 hIcon = LoadIconW(lpMsgBoxParams->hInstance, lpMsgBoxParams->lpszIcon);
710 break;
711 default:
712 /*
713 * By default, Windows 95/98/NT does not associate an icon
714 * to message boxes. So ReactOS should do the same.
715 */
716 hIcon = NULL;
718 break;
719 }
720 /* Reuse the internal pointer! */
721 lpMsgBoxParams->lpszIcon = (LPCWSTR)hIcon;
722
723 /* Basic space */
724 bufsize = sizeof(DLGTEMPLATE) +
725 2 * sizeof(WORD) + /* menu and class */
726 (caplen + 1) * sizeof(WCHAR) + /* title */
727 sizeof(WORD); /* font height */
728
729 /* Space for the icon */
730 if (hIcon)
731 {
733 bufsize += sizeof(DLGITEMTEMPLATE) +
734 4 * sizeof(WORD) +
735 sizeof(WCHAR);
736 }
737
738 /* Space for the text */
740 bufsize += sizeof(DLGITEMTEMPLATE) +
741 3 * sizeof(WORD) +
742 (textlen + 1) * sizeof(WCHAR);
743
744 /* Space for the buttons */
745 for (i = 0; i < mbd.dwButtons; i++)
746 {
747 if (!mbd.ppszButtonText[i] || !*mbd.ppszButtonText[i])
748 {
749 /* No text, use blank */
750 mbd.ppszButtonText[i] = L"";
751 ButtonLen = 0;
752 }
753 else
754 {
755 /* UNICODE string pointer */
756 ButtonLen = wcslen(mbd.ppszButtonText[i]);
757 }
758
760 bufsize += sizeof(DLGITEMTEMPLATE) +
761 3 * sizeof(WORD) +
762 (ButtonLen + 1) * sizeof(WCHAR);
763 }
764
765 /* Allocate the dialog template */
766 buf = RtlAllocateHeap(RtlGetProcessHeap(), 0, bufsize);
767 if (!buf)
768 goto Quit;
769
770 iico = itxt = NULL;
771
772
773 nclm.cbSize = sizeof(nclm);
774 SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(nclm), &nclm, 0);
775 hFont = CreateFontIndirectW(&nclm.lfMessageFont);
776 if (!hFont)
777 {
778 ERR("Cannot retrieve nclm.lfMessageFont! (error %lu)\n", GetLastError());
779 goto Quit;
780 }
781
782 hDCWnd = NULL;
783 hDC = GetDCEx(hDCWnd, NULL, DCX_WINDOW | DCX_CACHE);
784 if (!hDC)
785 {
786 /* Retry with the DC of the owner window */
787 hDCWnd = lpMsgBoxParams->hwndOwner;
788 hDC = GetDCEx(hDCWnd, NULL, DCX_WINDOW | DCX_CACHE);
789 }
790 if (!hDC)
791 {
792 ERR("GetDCEx() failed, bail out! (error %lu)\n", GetLastError());
793 goto Quit;
794 }
795 hOldFont = SelectObject(hDC, hFont);
796
798 if (!units.cx)
799 {
800 DWORD defUnits;
801 ERR("GdiGetCharDimensions() failed, falling back to default values (error %lu)\n", GetLastError());
802 defUnits = GetDialogBaseUnits();
803 units.cx = LOWORD(defUnits);
804 units.cy = HIWORD(defUnits);
805 }
806
807 /* Calculate the caption rectangle */
808 txtrect.right = MulDiv(GetSystemMetrics(SM_CXSCREEN), 4, 5);
809 if (hIcon)
811 txtrect.top = txtrect.left = txtrect.bottom = 0;
812 if (textlen != 0)
813 {
814 DrawTextW(hDC, lpMsgBoxParams->lpszText, textlen, &txtrect,
816 }
817 else
818 {
819 txtrect.right = txtrect.left + 1;
820 txtrect.bottom = txtrect.top + 1;
821 }
822 txtrect.right++;
823
824 /* Calculate the maximum buttons size */
825 btnsize.cx = BTN_CX;
826 btnsize.cy = BTN_CY;
827 btnrect.left = btnrect.top = 0;
828 for (i = 0; i < mbd.dwButtons; i++)
829 {
830 // btnrect.right = btnrect.bottom = 0; // FIXME: Is it needed??
832 &btnrect, DT_LEFT | DT_SINGLELINE | DT_CALCRECT);
833 btnsize.cx = max(btnsize.cx, btnrect.right);
834 btnsize.cy = max(btnsize.cy, btnrect.bottom);
835 }
836
837 if (hOldFont)
838 SelectObject(hDC, hOldFont);
839
840 ReleaseDC(hDCWnd, hDC);
841
842 if (hFont)
844
845
846 /* Calculate position and size of controls */
847
848
849 /* Calculate position and size of the icon */
850 rc.left = rc.bottom = rc.right = 0;
851 btntop = 0;
852 if (hIcon)
853 {
856#ifdef MSGBOX_ICONVCENTER
857 rc.top = MSGBOXEX_MARGIN + ((max(txtrect.bottom, rc.bottom) - rc.bottom) / 2);
858 rc.top = max(MSGBOXEX_SPACING, rc.top);
859#else
860 rc.top = MSGBOXEX_MARGIN;
861#endif
862 btnleft = (mbd.dwButtons * (btnsize.cx + MSGBOXEX_BUTTONSPACING)) - MSGBOXEX_BUTTONSPACING;
863 if (btnleft > txtrect.right + rc.right + MSGBOXEX_SPACING)
864 {
865#ifdef MSGBOX_TEXTHCENTER
866 rc.left = MSGBOXEX_MARGIN + ((btnleft - txtrect.right - rc.right - MSGBOXEX_SPACING) / 2);
867#else
869#endif
870 btnleft = MSGBOXEX_MARGIN;
871 }
872 else
873 {
875 btnleft = MSGBOXEX_MARGIN + ((txtrect.right + rc.right + MSGBOXEX_SPACING - btnleft) / 2);
876 }
877
879 iconPos.y = RESCALE_Y(rc.top, units);
880 iconSize.cx = RESCALE_X(rc.right, units);
881 iconSize.cy = RESCALE_Y(rc.bottom, units);
882
883 btntop = rc.top + rc.bottom + MSGBOXEX_SPACING;
884 rc.left += rc.right + MSGBOXEX_SPACING;
885 }
886 else
887 {
888 btnleft = (mbd.dwButtons * (btnsize.cx + MSGBOXEX_BUTTONSPACING)) - MSGBOXEX_BUTTONSPACING;
889 if (btnleft > txtrect.right)
890 {
891#ifdef MSGBOX_TEXTHCENTER
892 rc.left = MSGBOXEX_MARGIN + ((btnleft - txtrect.right) / 2);
893#else
895#endif
896 btnleft = MSGBOXEX_MARGIN;
897 }
898 else
899 {
901 btnleft = MSGBOXEX_MARGIN + ((txtrect.right - btnleft) / 2);
902 }
903 }
904
905
906 /* Initialize the dialog template */
907 tpl = (DLGTEMPLATE *)buf;
908
912 if (lpMsgBoxParams->dwStyle & MB_TOPMOST)
914 if (lpMsgBoxParams->dwStyle & MB_RIGHT)
916 tpl->x = 100;
917 tpl->y = 100;
918 tpl->cdit = mbd.dwButtons + (hIcon ? 1 : 0) + 1; /* Buttons, icon and text */
919
920 dest = (BYTE *)(tpl + 1);
921
922 *(DWORD*)dest = 0; /* no menu and use default window class */
923 dest += 2 * sizeof(WORD);
924 memcpy(dest, lpMsgBoxParams->lpszCaption, caplen * sizeof(WCHAR));
925 dest += caplen * sizeof(WCHAR);
926 *(WCHAR*)dest = L'\0';
927 dest += sizeof(WCHAR);
928
929 /*
930 * A font point size (height) of 0x7FFF means that we use
931 * the message box font (NONCLIENTMETRICSW.lfMessageFont).
932 */
933 *(WORD*)dest = 0x7FFF;
934 dest += sizeof(WORD);
935
936 /* Create the icon */
937 if (hIcon)
938 {
940 iico = (DLGITEMTEMPLATE *)dest;
941 iico->style = WS_CHILD | WS_VISIBLE | SS_ICON;
942 iico->dwExtendedStyle = 0;
943 iico->id = MSGBOX_IDICON;
944
945 iico->x = iconPos.x;
946 iico->y = iconPos.y;
947 iico->cx = iconSize.cx;
948 iico->cy = iconSize.cy;
949
950 dest += sizeof(DLGITEMTEMPLATE);
951 *(WORD*)dest = 0xFFFF;
952 dest += sizeof(WORD);
953 *(WORD*)dest = 0x0082; /* static control */
954 dest += sizeof(WORD);
955 *(WORD*)dest = 0xFFFF;
956 dest += sizeof(WORD);
957 *(WCHAR*)dest = 0;
958 dest += sizeof(WCHAR);
959 *(WORD*)dest = 0;
960 dest += sizeof(WORD);
961 }
962
963 /* Create static for text */
965 itxt = (DLGITEMTEMPLATE *)dest;
967 if (lpMsgBoxParams->dwStyle & MB_RIGHT)
968 itxt->style |= SS_RIGHT;
969 else
970 itxt->style |= SS_LEFT;
971 itxt->dwExtendedStyle = 0;
972 itxt->id = MSGBOX_IDTEXT;
973 dest += sizeof(DLGITEMTEMPLATE);
974 *(WORD*)dest = 0xFFFF;
975 dest += sizeof(WORD);
976 *(WORD*)dest = 0x0082; /* static control */
977 dest += sizeof(WORD);
978 memcpy(dest, lpMsgBoxParams->lpszText, textlen * sizeof(WCHAR));
979 dest += textlen * sizeof(WCHAR);
980 *(WCHAR*)dest = 0;
981 dest += sizeof(WCHAR);
982 *(WORD*)dest = 0;
983 dest += sizeof(WORD);
984
985
986 /* Calculate position of the text */
987 rc.top = MSGBOXEX_MARGIN + ((rc.bottom - txtrect.bottom) / 2);
988 rc.top = max(rc.top, MSGBOXEX_MARGIN);
989
990
991 /* Make the first button the default button if none other is */
992 if (mbd.uDefButton >= mbd.dwButtons)
993 mbd.uDefButton = 0;
994
995 /* Create and calculate the position of the buttons */
996 btntop = max(rc.top + txtrect.bottom + MSGBOXEX_SPACING, btntop);
997 for (i = 0; i < mbd.dwButtons; i++)
998 {
999 ButtonLen = wcslen(mbd.ppszButtonText[i]);
1000
1002 ibtn = (DLGITEMTEMPLATE *)dest;
1003
1004 ibtn->style = WS_CHILD | WS_VISIBLE | WS_TABSTOP;
1005 if (i == mbd.uDefButton)
1006 ibtn->style |= BS_DEFPUSHBUTTON;
1007 else
1008 ibtn->style |= BS_PUSHBUTTON;
1009
1010 ibtn->dwExtendedStyle = 0;
1011 ibtn->id = mbd.pidButton[i];
1012 dest += sizeof(DLGITEMTEMPLATE);
1013 *(WORD*)dest = 0xFFFF;
1014 dest += sizeof(WORD);
1015 *(WORD*)dest = 0x0080; /* button control */
1016 dest += sizeof(WORD);
1017 memcpy(dest, mbd.ppszButtonText[i], ButtonLen * sizeof(WCHAR));
1018 dest += ButtonLen * sizeof(WCHAR);
1019 *(WORD*)dest = 0;
1020 dest += sizeof(WORD);
1021 *(WORD*)dest = 0;
1022 dest += sizeof(WORD);
1023
1024 ibtn->x = RESCALE_X(btnleft, units);
1025 ibtn->y = RESCALE_Y(btntop, units);
1026 ibtn->cx = RESCALE_X(btnsize.cx, units);
1027 ibtn->cy = RESCALE_Y(btnsize.cy, units);
1028 btnleft += btnsize.cx + MSGBOXEX_BUTTONSPACING;
1029 }
1030
1031 /* Calculate the size and position of the message-box window */
1032 btnleft = max(btnleft - MSGBOXEX_BUTTONSPACING, rc.left + txtrect.right);
1033 btnleft += MSGBOXEX_MARGIN;
1034 if (mbd.dwButtons > 0)
1035 btntop += btnsize.cy + MSGBOXEX_MARGIN;
1036
1037 /* Set the size and position of the static message */
1038 itxt->x = RESCALE_X(rc.left, units);
1039 itxt->y = RESCALE_Y(rc.top, units);
1040 itxt->cx = RESCALE_X(btnleft - rc.left - MSGBOXEX_MARGIN, units);
1041 itxt->cy = RESCALE_Y(txtrect.bottom, units);
1042
1043 /* Set the size of the window */
1044 tpl->cx = RESCALE_X(btnleft, units);
1045 tpl->cy = RESCALE_Y(btntop, units);
1046
1047 /* Finally show the message-box */
1048 ERR("MessageBox: %s\n", wine_dbgstr_wn(lpMsgBoxParams->lpszText, textlen));
1049 ret = DialogBoxIndirectParamW(lpMsgBoxParams->hInstance, tpl,
1050 lpMsgBoxParams->hwndOwner,
1051 MessageBoxProc, (LPARAM)&mbd);
1052
1053Quit:
1054 if (buf)
1055 RtlFreeHeap(RtlGetProcessHeap(), 0, buf);
1056
1057 if (text)
1058 RtlFreeHeap(RtlGetProcessHeap(), 0, text);
1059
1060 if (caption)
1061 RtlFreeHeap(RtlGetProcessHeap(), 0, caption);
1062
1063 return ret;
1064}
static HDC hDC
Definition: 3dtext.c:33
HFONT hFont
Definition: main.c:53
const char * wine_dbgstr_wn(const WCHAR *str, int n)
Definition: compat.c:367
const WCHAR * text
Definition: package.c:1799
#define PtrToUlong(u)
Definition: config.h:107
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat units
Definition: glext.h:11727
GLenum GLuint GLsizei bufsize
Definition: glext.h:7473
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static char * dest
Definition: rtl.c:135
HICON hIcon
Definition: msconfig.c:44
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define WS_CHILD
Definition: pedump.c:617
#define WS_CAPTION
Definition: pedump.c:624
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_SYSMENU
Definition: pedump.c:629
#define SS_RIGHT
Definition: pedump.c:694
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define SS_LEFT
Definition: pedump.c:692
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
#define SS_ICON
Definition: pedump.c:695
POINT iconPos
Definition: startmenu.cpp:1391
DWORD dwExtendedStyle
Definition: winuser.h:3050
WORD cdit
Definition: winuser.h:3061
short y
Definition: winuser.h:3063
short cy
Definition: winuser.h:3065
DWORD style
Definition: winuser.h:3059
DWORD dwExtendedStyle
Definition: winuser.h:3060
short x
Definition: winuser.h:3062
short cx
Definition: winuser.h:3064
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define max(a, b)
Definition: svc.c:63
#define HIWORD(l)
Definition: typedefs.h:247
#define ALIGN_UP(size, type)
Definition: umtypes.h:91
#define ALIGN_UP_POINTER(ptr, type)
Definition: umtypes.h:97
BOOL WINAPI MessageBeep(IN UINT uType)
Definition: messagebox.c:1329
#define MSGBOXEX_MARGIN
Definition: messagebox.c:58
#define RESCALE_Y(_y, _units)
Definition: messagebox.c:64
static INT_PTR CALLBACK MessageBoxProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: messagebox.c:248
#define BTN_CX
Definition: messagebox.c:53
#define IDI_HANDW
Definition: messagebox.c:44
#define RESCALE_X(_x, _units)
Definition: messagebox.c:63
#define IDI_QUESTIONW
Definition: messagebox.c:45
#define IDI_ASTERISKW
Definition: messagebox.c:47
#define BTN_CY
Definition: messagebox.c:54
#define MSGBOXEX_SPACING
Definition: messagebox.c:56
#define MSGBOXEX_BUTTONSPACING
Definition: messagebox.c:57
#define IDI_EXCLAMATIONW
Definition: messagebox.c:46
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
Definition: font.c:2145
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define MB_TOPMOST
Definition: winuser.h:825
#define DT_NOPREFIX
Definition: winuser.h:537
#define MB_RIGHT
Definition: winuser.h:795
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define DT_EXTERNALLEADING
Definition: winuser.h:533
#define DCX_CACHE
Definition: winuser.h:2114
#define DCX_WINDOW
Definition: winuser.h:2113
#define MB_ICONHAND
Definition: winuser.h:788
#define DS_NOIDLEMSG
Definition: winuser.h:377
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define DT_SINGLELINE
Definition: winuser.h:540
#define SS_NOPREFIX
Definition: winuser.h:350
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
#define DS_MODALFRAME
Definition: winuser.h:375
#define DT_LEFT
Definition: winuser.h:534
#define SM_CYICON
Definition: winuser.h:973
#define DT_WORDBREAK
Definition: winuser.h:544
#define DS_CENTER
Definition: winuser.h:369
#define DS_SETFONT
Definition: winuser.h:378
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define MB_ICONEXCLAMATION
Definition: winuser.h:785
LONG WINAPI GetDialogBaseUnits(void)
Definition: dialog.c:2144
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SM_CXSCREEN
Definition: winuser.h:959
#define DT_EXPANDTABS
Definition: winuser.h:532
#define DT_CALCRECT
Definition: winuser.h:526
#define MB_ICONASTERISK
Definition: winuser.h:784
#define DT_EDITCONTROL
Definition: winuser.h:528
#define SM_CXICON
Definition: winuser.h:972
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
int WINAPI GetSystemMetrics(_In_ int)
#define WS_EX_RIGHT
Definition: winuser.h:400
unsigned char BYTE
Definition: xxhash.c:193

Referenced by MessageBoxTimeoutIndirectW(), and TestSoftModalMsgBox().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )

Variable Documentation

◆ MsgBtnInfo

const MSGBTNINFO MsgBtnInfo[]
static
Initial value:
=
{
DECLARE_MB_2(OK, CANCEL),
DECLARE_MB_3(YES, NO, CANCEL),
DECLARE_MB_2(YES, NO),
DECLARE_MB_2(RETRY, CANCEL),
}
#define IGNORE
#define ABORT
Definition: ftp_var.h:30
#define OK(condition, fail_message,...)
#define DECLARE_MB_2(_btn0, _btn1)
Definition: messagebox.c:72
#define DECLARE_MB_1(_btn0)
Definition: messagebox.c:69
#define DECLARE_MB_3(_btn0, _btn1, _btn2)
Definition: messagebox.c:75

Definition at line 86 of file messagebox.c.

Referenced by MessageBoxTimeoutIndirectW().