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;
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
static const WCHAR szName[]
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
#define OK(condition, fail_message,...)
int WINAPI MessageBoxIndirectA(IN CONST MSGBOXPARAMSA *lpMsgBoxParams)
int WINAPI MessageBoxA(IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
int WINAPI MessageBoxTimeoutW(IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType, IN WORD wLanguageId, IN DWORD dwTimeout)
_In_ ULONG _In_ ULONG _In_ ULONG Length
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
#define ALIGN_UP(size, type)
#define MSGBOXEX_MAXBTNSTR
void WINAPI NotifyWinEvent(DWORD, HWND, LONG, LONG)
int WINAPI SoftModalMessageBox(IN LPMSGBOXDATA lpMsgBoxData)
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
#define MSGBOXEX_BUTTONSPACING
static INT_PTR CALLBACK MessageBoxProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
LPCWSTR WINAPI MB_GetString(IN UINT wBtn)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
EXTINLINE BOOL NtUserxSetMessageBox(HWND hWnd)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DECLARE_MB_1(_btn0)
int WINAPI MessageBoxExW(IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
GLenum GLuint GLsizei bufsize
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define MB_ICONEXCLAMATION
struct tagHELPINFO * LPHELPINFO
GLenum GLuint GLenum GLsizei const GLchar * buf
#define HARDERROR_OVERRIDE_ERRORMODE
int WINAPI MessageBoxW(IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType)
UINT btnIds[MSGBOXEX_MAXBTNS]
#define WS_EX_CONTROLPARENT
struct _MSGBOXDATA * PMSGBOXDATA
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI SetWindowContextHelpId(_In_ HWND, _In_ DWORD)
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define WS_EX_DLGMODALFRAME
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
static VOID MessageBoxTextToClipboard(HWND DialogWindow)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
WINE_DEFAULT_DEBUG_CHANNEL(user32)
int WINAPI MessageBoxIndirectW(IN CONST MSGBOXPARAMSW *lpMsgBoxParams)
BOOL WINAPI EmptyClipboard(void)
static UINT LoadAllocStringW(IN HINSTANCE hInstance OPTIONAL, IN UINT uID, OUT PWSTR *pString, IN PCWSTR pDefaultString OPTIONAL)
static const TBBUTTON Buttons[]
DWORD_PTR dwContextHelpId
#define IS_INTRESOURCE(i)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define NT_SUCCESS(StatCode)
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)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
int WINAPI GetWindowTextLengthW(_In_ HWND)
DWORD WINAPI GetWindowContextHelpId(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct _MSGBTNINFO MSGBTNINFO
BOOL WINAPI CloseClipboard(void)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
EXTINLINE BOOL NtUserxMessageBeep(UINT uType)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
INT btnIdx[MSGBOXEX_MAXBTNS]
int WINAPI MessageBoxTimeoutA(IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType, IN WORD wLanguageId, IN DWORD dwTimeout)
#define memcpy(s1, s2, n)
const char * wine_dbgstr_wn(const WCHAR *str, int n)
#define RESCALE_X(_x, _units)
#define DECLARE_MB_3(_btn0, _btn1, _btn2)
static int MessageBoxTimeoutIndirectW(CONST MSGBOXPARAMSW *lpMsgBoxParams, UINT dwTimeout)
static const WCHAR textW[]
BOOL WINAPI MessageBeep(IN UINT uType)
MSGBOXCALLBACK lpfnMsgBoxCallback
static const WCHAR iconW[]
static const MSGBTNINFO MsgBtnInfo[]
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
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
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
#define DT_EXTERNALLEADING
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ALIGN_UP_POINTER(ptr, type)
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define DECLARE_MB_2(_btn0, _btn1)
MSGBOXCALLBACK lpfnMsgBoxCallback
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define RESCALE_Y(_y, _units)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define SetWindowLongPtrW
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
#define STATUS_SERVICE_NOTIFICATION
int WINAPI MessageBoxExA(IN HWND hWnd, IN LPCSTR lpText, IN LPCSTR lpCaption, IN UINT uType, IN WORD wLanguageId)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
DWORD_PTR dwContextHelpId
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
struct _MSGBTNINFO * PMSGBTNINFO
LONG WINAPI GetDialogBaseUnits(void)
PULONG MinorVersion OPTIONAL