41#define MSGBOX_IDICON (1088)
42#define MSGBOX_IDTEXT (0xffff)
44#define IDI_HANDW MAKEINTRESOURCEW(32513)
45#define IDI_QUESTIONW MAKEINTRESOURCEW(32514)
46#define IDI_EXCLAMATIONW MAKEINTRESOURCEW(32515)
47#define IDI_ASTERISKW MAKEINTRESOURCEW(32516)
48#define IDI_WINLOGOW MAKEINTRESOURCEW(32517)
56#define MSGBOXEX_SPACING (16)
57#define MSGBOXEX_BUTTONSPACING (6)
58#define MSGBOXEX_MARGIN (12)
59#define MSGBOXEX_MAXBTNSTR (32)
60#define MSGBOXEX_MAXBTNS (4)
63#define RESCALE_X(_x, _units) (((_x) * 4 + (_units).cx - 1) / (_units).cx)
64#define RESCALE_Y(_y, _units) (((_y) * 8 + (_units).cy - 1) / (_units).cy)
69#define DECLARE_MB_1(_btn0) \
70 { 1, { ID##_btn0, 0, 0 }, { IDS_##_btn0, 0, 0 } }
72#define DECLARE_MB_2(_btn0, _btn1) \
73 { 2, { ID##_btn0, ID##_btn1, 0 }, { IDS_##_btn0, IDS_##_btn1, 0 } }
75#define DECLARE_MB_3(_btn0, _btn1, _btn2) \
76 { 3, { ID##_btn0, ID##_btn1, ID##_btn2 }, { IDS_##_btn0, IDS_##_btn1, IDS_##_btn2 } }
130 pStr = pDefaultString;
149 LPWSTR pszBuffer, pszBufferPos, pMessageBoxText, pszTitle, pszText, pszButton;
153 static const WCHAR szLine[] =
L"---------------------------\r\n";
165 if (pMessageBoxText ==
NULL)
171 pszTitle = pMessageBoxText;
172 pszText = pMessageBoxText + cchTitle;
190 if (pszBuffer ==
NULL)
205 cchBuffer =
wsprintfW(pszBuffer,
L"%s%s\r\n%s%s\r\n%s", szLine, pszTitle, szLine, pszText, szLine);
213 pszButton = szButton;
216 if (szButton[0] ==
'&')
218 pszButton = pszButton + 1;
219 cchButton = cchButton - 1;
222 for (
n = 0;
n < cchButton;
n++)
223 *(pszBufferPos++) = pszButton[
n];
226 *(pszBufferPos++) =
L' ';
227 *(pszBufferPos++) =
L' ';
228 *(pszBufferPos++) =
L' ';
269 if (mbd->mbp.dwContextHelpId)
272 if (mbd->mbp.lpszIcon)
275 Alert = ALERT_SYSTEM_WARNING;
282 Alert = ALERT_SYSTEM_WARNING;
285 Alert = ALERT_SYSTEM_ERROR;
288 Alert = ALERT_SYSTEM_QUERY;
291 Alert = ALERT_SYSTEM_INFORMATIONAL;
299 if (mbd->uCancelId == 0)
307 if (mbd->dwButtons > 0)
309 ASSERT(mbd->uDefButton < mbd->dwButtons);
314 if (mbd->dwTimeout && (mbd->dwTimeout != (
UINT)-1))
461 if (lpMsgBoxParams->dwStyle & MB_SERVICE_NOTIFICATION)
475 lpMsgBoxParams->dwStyle & ~MB_SERVICE_NOTIFICATION,
480 if (lpMsgBoxParams->hwndOwner !=
NULL)
482 ERR(
"MessageBoxTimeoutIndirectW(MB_SERVICE_NOTIFICATION): hwndOwner is not NULL!\n");
501 ERR(
"MessageBoxTimeoutIndirectW(MB_SERVICE_NOTIFICATION): NtRaiseHardError failed, Status = 0x%08lx\n",
Status);
563 if (lpMsgBoxParams->dwStyle &
MB_HELP)
604 if (ButtonText[
i] && *ButtonText[
i])
624 NONCLIENTMETRICSW nclm;
633 int bufsize, caplen, textlen,
i, btnleft, btntop;
635 RECT btnrect, txtrect, rc;
640 memcpy(&mbd, lpMsgBoxData,
sizeof(mbd));
726 (caplen + 1) *
sizeof(
WCHAR) +
742 (textlen + 1) *
sizeof(
WCHAR);
762 (ButtonLen + 1) *
sizeof(
WCHAR);
773 nclm.cbSize =
sizeof(nclm);
778 ERR(
"Cannot retrieve nclm.lfMessageFont! (error %lu)\n",
GetLastError());
801 ERR(
"GdiGetCharDimensions() failed, falling back to default values (error %lu)\n",
GetLastError());
827 btnrect.
left = btnrect.
top = 0;
856#ifdef MSGBOX_ICONVCENTER
865#ifdef MSGBOX_TEXTHCENTER
889 if (btnleft > txtrect.
right)
891#ifdef MSGBOX_TEXTHCENTER
947 iico->
cx = iconSize.
cx;
948 iico->
cy = iconSize.
cy;
1112 msgbox.
cbSize =
sizeof(msgbox);
1140 msgbox.
cbSize =
sizeof(msgbox);
1208 msgboxW.
cbSize =
sizeof(msgboxW);
1209 msgboxW.
hwndOwner = lpMsgBoxParams->hwndOwner;
1210 msgboxW.
hInstance = lpMsgBoxParams->hInstance;
1213 msgboxW.
dwStyle = lpMsgBoxParams->dwStyle;
1272 msgboxW.
cbSize =
sizeof(msgboxW);
1309 msgbox.
cbSize =
sizeof(msgbox);
1377 return MBStrings[wBtn].
szName;
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define NT_SUCCESS(StatCode)
const char * wine_dbgstr_wn(const WCHAR *str, int n)
static const WCHAR iconW[]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLsizei bufsize
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
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
struct _MSGBOXDATA * PMSGBOXDATA
static const WCHAR textW[]
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static const TBBUTTON Buttons[]
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define HARDERROR_OVERRIDE_ERRORMODE
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_SERVICE_NOTIFICATION
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)
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
EXTINLINE BOOL NtUserxMessageBeep(UINT uType)
EXTINLINE BOOL NtUserxSetMessageBox(HWND hWnd)
#define WS_EX_DLGMODALFRAME
static const WCHAR szName[]
PULONG MinorVersion OPTIONAL
MSGBOXCALLBACK lpfnMsgBoxCallback
DWORD_PTR dwContextHelpId
DWORD_PTR dwContextHelpId
MSGBOXCALLBACK lpfnMsgBoxCallback
INT btnIdx[MSGBOXEX_MAXBTNS]
UINT btnIds[MSGBOXEX_MAXBTNS]
#define ALIGN_UP(size, type)
#define ALIGN_UP_POINTER(ptr, type)
int WINAPI SoftModalMessageBox(IN LPMSGBOXDATA lpMsgBoxData)
#define OK(condition, fail_message,...)
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
static int MessageBoxTimeoutIndirectW(CONST MSGBOXPARAMSW *lpMsgBoxParams, UINT dwTimeout)
static UINT LoadAllocStringW(IN HINSTANCE hInstance OPTIONAL, IN UINT uID, OUT PWSTR *pString, IN PCWSTR pDefaultString OPTIONAL)
int WINAPI MessageBoxExA(IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
BOOL WINAPI MessageBeep(IN UINT uType)
int WINAPI MessageBoxIndirectA(IN CONST MSGBOXPARAMSA *lpMsgBoxParams)
static VOID MessageBoxTextToClipboard(HWND DialogWindow)
#define RESCALE_Y(_y, _units)
static INT_PTR CALLBACK MessageBoxProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
int WINAPI MessageBoxTimeoutA(IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType, IN WORD wLanguageId, IN DWORD dwTimeout)
struct _MSGBTNINFO MSGBTNINFO
#define RESCALE_X(_x, _units)
struct _MSGBTNINFO * PMSGBTNINFO
int WINAPI MessageBoxIndirectW(IN CONST MSGBOXPARAMSW *lpMsgBoxParams)
int WINAPI MessageBoxExW(IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
int WINAPI MessageBoxTimeoutW(IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType, IN WORD wLanguageId, IN DWORD dwTimeout)
#define DECLARE_MB_2(_btn0, _btn1)
static const MSGBTNINFO MsgBtnInfo[]
#define DECLARE_MB_1(_btn0)
#define MSGBOXEX_MAXBTNSTR
#define MSGBOXEX_BUTTONSPACING
int WINAPI MessageBoxA(IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType)
LPCWSTR WINAPI MB_GetString(IN UINT wBtn)
#define DECLARE_MB_3(_btn0, _btn1, _btn2)
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
void WINAPI NotifyWinEvent(DWORD, HWND, LONG, LONG)
DWORD WINAPI GetLastError(void)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define DT_EXTERNALLEADING
struct tagHELPINFO * LPHELPINFO
BOOL WINAPI SetWindowContextHelpId(_In_ HWND, _In_ DWORD)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WS_EX_CONTROLPARENT
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
#define IS_INTRESOURCE(i)
BOOL WINAPI CloseClipboard(void)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
DWORD WINAPI GetWindowContextHelpId(_In_ HWND)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
BOOL WINAPI EmptyClipboard(void)
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define MB_ICONEXCLAMATION
LONG WINAPI GetDialogBaseUnits(void)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define SetWindowLongPtrW
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)