blob: 6c7a5d0d49b3ca9233a0dbb64863d52bcdad9063 [file] [log] [blame]
Alexandre Julliard2787be81995-05-22 18:23:01 +00001/*
2 * Message boxes
3 *
4 * Copyright 1995 Bernd Schmidt
Alexandre Julliard2787be81995-05-22 18:23:01 +00005 */
6
David Luyeree517e81999-02-28 12:27:56 +00007#include <string.h>
Patrik Stridvall1ed4ecf1999-06-26 14:58:24 +00008
9#include "wine/winbase16.h"
Michael Vekslerca1bc861999-01-01 18:57:33 +000010#include "wine/winuser16.h"
Alexandre Julliard2787be81995-05-22 18:23:01 +000011#include "dlgs.h"
Alexandre Julliard7ebe1a41996-12-22 18:27:48 +000012#include "heap.h"
Marcus Meissnerd7c565f1999-05-14 18:39:37 +000013#include "ldt.h"
Alexandre Julliard359f497e1999-07-04 16:02:24 +000014#include "debugtools.h"
Alexandre Julliard54c27111998-03-29 19:44:57 +000015#include "debugstr.h"
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000016#include "tweak.h"
Alexandre Julliard2787be81995-05-22 18:23:01 +000017
Patrik Stridvallb4b9fae1999-04-19 14:56:29 +000018DEFAULT_DEBUG_CHANNEL(dialog)
19
Richard Cohend38bcea1999-09-03 16:38:03 +000020#define MSGBOX_IDICON 1088
21#define MSGBOX_IDTEXT 100
22
23static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb)
24{
25 static HFONT hFont = 0, hPrevFont = 0;
26 RECT rect;
27 HWND hItem;
28 HDC hdc;
29 int i, buttons;
30 int bspace, bw, bh, theight, tleft, wwidth, wheight, bpos;
31 int borheight, borwidth, iheight, ileft, iwidth, twidth, tiheight;
32
33 if (TWEAK_WineLook >= WIN95_LOOK) {
34 NONCLIENTMETRICSA nclm;
35 INT i;
36 nclm.cbSize = sizeof(NONCLIENTMETRICSA);
37 SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
38 hFont = CreateFontIndirectA (&nclm.lfMessageFont);
39 /* set button font */
40 for (i=1; i < 8; i++)
41 SendDlgItemMessageA (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0);
42 /* set text font */
43 SendDlgItemMessageA (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0);
44 }
45 if (lpmb->lpszCaption) SetWindowTextA(hwnd, lpmb->lpszCaption);
46 SetWindowTextA(GetDlgItem(hwnd, MSGBOX_IDTEXT), lpmb->lpszText);
47 /* Hide not selected buttons */
48 switch(lpmb->dwStyle & MB_TYPEMASK) {
49 case MB_OK:
50 ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
51 /* fall through */
52 case MB_OKCANCEL:
53 ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
54 ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE);
55 ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
56 ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
57 ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
58 break;
59 case MB_ABORTRETRYIGNORE:
60 ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
61 ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
62 ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
63 ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
64 break;
65 case MB_YESNO:
66 ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
67 /* fall through */
68 case MB_YESNOCANCEL:
69 ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
70 ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
71 ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE);
72 ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
73 break;
74 case MB_RETRYCANCEL:
75 ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
76 ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
77 ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
78 ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
79 ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
80 break;
81 }
82 /* Set the icon */
83 switch(lpmb->dwStyle & MB_ICONMASK) {
84 case MB_ICONEXCLAMATION:
85 SendDlgItemMessage16(hwnd, stc1, STM_SETICON16,
86 (WPARAM16)LoadIcon16(0, IDI_EXCLAMATION16), 0);
87 break;
88 case MB_ICONQUESTION:
89 SendDlgItemMessage16(hwnd, stc1, STM_SETICON16,
90 (WPARAM16)LoadIcon16(0, IDI_QUESTION16), 0);
91 break;
92 case MB_ICONASTERISK:
93 SendDlgItemMessage16(hwnd, stc1, STM_SETICON16,
94 (WPARAM16)LoadIcon16(0, IDI_ASTERISK16), 0);
95 break;
96 case MB_ICONHAND:
97 default:
98 SendDlgItemMessage16(hwnd, stc1, STM_SETICON16,
99 (WPARAM16)LoadIcon16(0, IDI_HAND16), 0);
100 break;
101 }
102
103 /* Position everything */
104 GetWindowRect(hwnd, &rect);
105 borheight = rect.bottom - rect.top;
106 borwidth = rect.right - rect.left;
107 GetClientRect(hwnd, &rect);
108 borheight -= rect.bottom - rect.top;
109 borwidth -= rect.right - rect.left;
110
111 /* Get the icon height */
112 GetWindowRect(GetDlgItem(hwnd, MSGBOX_IDICON), &rect);
113 MapWindowPoints(0, hwnd, (LPPOINT)&rect, 2);
114 iheight = rect.bottom - rect.top;
115 ileft = rect.left;
116 iwidth = rect.right - ileft;
117
118 hdc = GetDC(hwnd);
119 if (hFont)
120 hPrevFont = SelectObject(hdc, hFont);
121
122 /* Get the number of visible buttons and their size */
123 bh = bw = 1; /* Minimum button sizes */
124 for (buttons = 0, i = 1; i < 8; i++)
125 {
126 hItem = GetDlgItem(hwnd, i);
127 if (GetWindowLongA(hItem, GWL_STYLE) & WS_VISIBLE)
128 {
129 char buttonText[1024];
130 int w, h;
131 buttons++;
132 if (GetWindowTextA(hItem, buttonText, sizeof buttonText))
133 {
134 DrawTextA( hdc, buttonText, -1, &rect, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT);
135 h = rect.bottom - rect.top;
136 w = rect.right - rect.left;
137 if (h > bh) bh = h;
138 if (w > bw) bw = w ;
139 }
140 }
141 }
142 bw = MAX(bw, bh * 2);
143 /* Button white space */
144 bh = bh * 2;
145 bw = bw * 2;
146 bspace = bw/3; /* Space between buttons */
147
148 /* Get the text size */
149 GetClientRect(GetDlgItem(hwnd, MSGBOX_IDTEXT), &rect);
150 rect.top = rect.left = rect.bottom = 0;
151 DrawTextA( hdc, lpmb->lpszText, -1, &rect,
152 DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT);
153 /* Min text width corresponds to space for the buttons */
154 tleft = 2 * ileft + iwidth;
155 twidth = MAX((bw + bspace) * buttons + bspace - tleft, rect.right);
156 theight = rect.bottom;
157
158 if (hFont)
159 SelectObject(hdc, hPrevFont);
160 ReleaseDC(hItem, hdc);
161
162 tiheight = 16 + MAX(iheight, theight);
163 wwidth = tleft + twidth + ileft + borwidth;
164 wheight = 8 + tiheight + bh + borheight;
165
166 /* Resize the window */
167 SetWindowPos(hwnd, 0, 0, 0, wwidth, wheight,
168 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
169
170 /* Position the icon */
171 SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDICON), 0, ileft, (tiheight - iheight) / 2, 0, 0,
172 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
173
174 /* Position the text */
175 SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDTEXT), 0, tleft, (tiheight - theight) / 2, twidth, theight,
176 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
177
178 /* Position the buttons */
179 bpos = (wwidth - (bw + bspace) * buttons + bspace) / 2;
180 for (buttons = i = 0; i < 7; i++) {
181 /* some arithmetic to get the right order for YesNoCancel windows */
182 hItem = GetDlgItem(hwnd, (i + 5) % 7 + 1);
183 if (GetWindowLongA(hItem, GWL_STYLE) & WS_VISIBLE) {
184 if (buttons++ == ((lpmb->dwStyle & MB_DEFMASK) >> 8)) {
185 SetFocus(hItem);
186 SendMessageA( hItem, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
187 }
188 SetWindowPos(hItem, 0, bpos, tiheight, bw, bh,
189 SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);
190 bpos += bw + bspace;
191 }
192 }
193 return hFont;
194}
195
196
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000197/**************************************************************************
198 * MSGBOX_DlgProc
199 *
200 * Dialog procedure for message boxes.
201 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000202static LRESULT CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
203 WPARAM wParam, LPARAM lParam )
Richard Cohend38bcea1999-09-03 16:38:03 +0000204{
Alexandre Julliard04699cc1999-09-04 11:21:10 +0000205 static HFONT hFont;
Alexandre Julliard2787be81995-05-22 18:23:01 +0000206 switch(message) {
207 case WM_INITDIALOG:
Richard Cohend38bcea1999-09-03 16:38:03 +0000208 hFont = MSGBOX_OnInit(hwnd, (LPMSGBOXPARAMSA)lParam);
Alexandre Julliard2787be81995-05-22 18:23:01 +0000209 return 0;
Alexandre Julliard2787be81995-05-22 18:23:01 +0000210
211 case WM_COMMAND:
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000212 switch (wParam)
213 {
Alexandre Julliard2787be81995-05-22 18:23:01 +0000214 case IDOK:
215 case IDCANCEL:
216 case IDABORT:
217 case IDRETRY:
218 case IDIGNORE:
219 case IDYES:
220 case IDNO:
Alexandre Julliarda3960291999-02-26 11:11:13 +0000221 EndDialog(hwnd, wParam);
Richard Cohend38bcea1999-09-03 16:38:03 +0000222 if (hFont)
223 DeleteObject(hFont);
Alexandre Julliard2787be81995-05-22 18:23:01 +0000224 break;
225 }
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000226
Alexandre Julliard54c27111998-03-29 19:44:57 +0000227 default:
228 /* Ok. Ignore all the other messages */
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000229 TRACE("Message number %i is being ignored.\n", message);
Alexandre Julliard2787be81995-05-22 18:23:01 +0000230 break;
231 }
232 return 0;
233}
234
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000235
Alexandre Julliard2787be81995-05-22 18:23:01 +0000236/**************************************************************************
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000237 * MessageBox16 (USER.1)
Alexandre Julliard2787be81995-05-22 18:23:01 +0000238 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000239INT16 WINAPI MessageBox16( HWND16 hwnd, LPCSTR text, LPCSTR title, UINT16 type)
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000240{
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000241 WARN("Messagebox\n");
Alexandre Julliarda3960291999-02-26 11:11:13 +0000242 return MessageBoxA( hwnd, text, title, type );
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000243}
Alexandre Julliard2787be81995-05-22 18:23:01 +0000244
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000245
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000246/**************************************************************************
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000247 * MessageBox32A (USER32.391)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000248 *
249 * NOTES
250 * The WARN is here to help debug erroneous MessageBoxes
251 * Use: -debugmsg warn+dialog,+relay
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000252 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000253INT WINAPI MessageBoxA(HWND hWnd, LPCSTR text, LPCSTR title, UINT type)
Alexandre Julliard2787be81995-05-22 18:23:01 +0000254{
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000255 LPVOID template;
256 HRSRC hRes;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000257 MSGBOXPARAMSA mbox;
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000258
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000259 WARN("Messagebox\n");
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000260
261 if(!(hRes = FindResourceA(GetModuleHandleA("USER32"), "MSGBOX", RT_DIALOGA)))
262 return 0;
263 if(!(template = (LPVOID)LoadResource(GetModuleHandleA("USER32"), hRes)))
264 return 0;
265
Alexandre Julliard349a9531997-02-02 19:01:52 +0000266 if (!text) text="<WINE-NULL>";
Alexandre Julliard54c27111998-03-29 19:44:57 +0000267 if (!title)
268 title="Error";
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000269 mbox.lpszCaption = title;
270 mbox.lpszText = text;
271 mbox.dwStyle = type;
Marcus Meissnerd7c565f1999-05-14 18:39:37 +0000272 return DialogBoxIndirectParamA( GetWindowLongA(hWnd,GWL_HINSTANCE), template,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000273 hWnd, (DLGPROC)MSGBOX_DlgProc, (LPARAM)&mbox );
Alexandre Julliard2787be81995-05-22 18:23:01 +0000274}
275
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000276
Alexandre Julliard2787be81995-05-22 18:23:01 +0000277/**************************************************************************
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000278 * MessageBox32W (USER32.396)
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000279 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000280INT WINAPI MessageBoxW( HWND hwnd, LPCWSTR text, LPCWSTR title,
281 UINT type )
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000282{
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000283 LPSTR titleA = HEAP_strdupWtoA( GetProcessHeap(), 0, title );
284 LPSTR textA = HEAP_strdupWtoA( GetProcessHeap(), 0, text );
Alexandre Julliarda3960291999-02-26 11:11:13 +0000285 INT ret;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000286
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000287 WARN("Messagebox\n");
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000288
Alexandre Julliarda3960291999-02-26 11:11:13 +0000289 ret = MessageBoxA( hwnd, textA, titleA, type );
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000290 HeapFree( GetProcessHeap(), 0, titleA );
291 HeapFree( GetProcessHeap(), 0, textA );
Alexandre Julliardb1bac321996-12-15 19:45:59 +0000292 return ret;
293}
294
Alexandre Julliard2787be81995-05-22 18:23:01 +0000295
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000296/**************************************************************************
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000297 * MessageBoxEx32A (USER32.392)
Alexandre Julliard349a9531997-02-02 19:01:52 +0000298 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000299INT WINAPI MessageBoxExA( HWND hWnd, LPCSTR text, LPCSTR title,
300 UINT type, WORD langid )
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000301{
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000302 WARN("Messagebox\n");
Alexandre Julliard349a9531997-02-02 19:01:52 +0000303 /* ignore language id for now */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000304 return MessageBoxA(hWnd,text,title,type);
Alexandre Julliard349a9531997-02-02 19:01:52 +0000305}
306
307/**************************************************************************
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000308 * MessageBoxEx32W (USER32.393)
Alexandre Julliard349a9531997-02-02 19:01:52 +0000309 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000310INT WINAPI MessageBoxExW( HWND hWnd, LPCWSTR text, LPCWSTR title,
311 UINT type, WORD langid )
Alexandre Julliard349a9531997-02-02 19:01:52 +0000312{
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000313 WARN("Messagebox\n");
Alexandre Julliard349a9531997-02-02 19:01:52 +0000314 /* ignore language id for now */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000315 return MessageBoxW(hWnd,text,title,type);
Alexandre Julliard349a9531997-02-02 19:01:52 +0000316}
317
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000318/**************************************************************************
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000319 * MessageBoxIndirect16 (USER.827)
320 */
321INT16 WINAPI MessageBoxIndirect16( LPMSGBOXPARAMS16 msgbox )
322{
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000323 LPVOID template;
324 HRSRC hRes;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000325 MSGBOXPARAMSA msgbox32;
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000326
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000327 WARN("Messagebox\n");
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000328
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000329 if(!(hRes = FindResourceA(GetModuleHandleA("USER32"), "MSGBOX", RT_DIALOGA)))
330 return 0;
331 if(!(template = (LPVOID)LoadResource(GetModuleHandleA("USER32"), hRes)))
332 return 0;
333
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000334 msgbox32.cbSize = msgbox->cbSize;
335 msgbox32.hwndOwner = msgbox->hwndOwner;
336 msgbox32.hInstance = msgbox->hInstance;
337 msgbox32.lpszText = PTR_SEG_TO_LIN(msgbox->lpszText);
338 msgbox32.lpszCaption = PTR_SEG_TO_LIN(msgbox->lpszCaption);
339 msgbox32.dwStyle = msgbox->dwStyle;
340 msgbox32.lpszIcon = PTR_SEG_TO_LIN(msgbox->lpszIcon);
341 msgbox32.dwContextHelpId = msgbox->dwContextHelpId;
342 msgbox32.lpfnMsgBoxCallback = msgbox->lpfnMsgBoxCallback;
343 msgbox32.dwLanguageId = msgbox->dwLanguageId;
344
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000345 return DialogBoxIndirectParamA( msgbox32.hInstance, template,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000346 msgbox32.hwndOwner, (DLGPROC)MSGBOX_DlgProc,
Alexandre Julliardc7c217b1998-04-13 12:21:30 +0000347 (LPARAM)&msgbox32 );
348}
349
350/**************************************************************************
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000351 * MessageBoxIndirect32A (USER32.394)
352 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000353INT WINAPI MessageBoxIndirectA( LPMSGBOXPARAMSA msgbox )
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000354{
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000355 LPVOID template;
356 HRSRC hRes;
357
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000358 WARN("Messagebox\n");
Bertho Stultiensd1895a71999-04-25 18:31:35 +0000359
360 if(!(hRes = FindResourceA(GetModuleHandleA("USER32"), "MSGBOX", RT_DIALOGA)))
361 return 0;
362 if(!(template = (LPVOID)LoadResource(GetModuleHandleA("USER32"), hRes)))
363 return 0;
364
365 return DialogBoxIndirectParamA( msgbox->hInstance, template,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000366 msgbox->hwndOwner, (DLGPROC)MSGBOX_DlgProc,
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000367 (LPARAM)msgbox );
368}
369
370/**************************************************************************
371 * MessageBoxIndirect32W (USER32.395)
372 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000373INT WINAPI MessageBoxIndirectW( LPMSGBOXPARAMSW msgbox )
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000374{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000375 MSGBOXPARAMSA msgboxa;
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000376 WARN("Messagebox\n");
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000377
378 memcpy(&msgboxa,msgbox,sizeof(msgboxa));
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000379 if (msgbox->lpszCaption)
Andreas Mohr7a6228d1998-12-11 09:16:48 +0000380 lstrcpyWtoA((LPSTR)msgboxa.lpszCaption,msgbox->lpszCaption);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000381 if (msgbox->lpszText)
Andreas Mohr7a6228d1998-12-11 09:16:48 +0000382 lstrcpyWtoA((LPSTR)msgboxa.lpszText,msgbox->lpszText);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000383
Alexandre Julliarda3960291999-02-26 11:11:13 +0000384 return MessageBoxIndirectA(&msgboxa);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000385}
386
Alexandre Julliard349a9531997-02-02 19:01:52 +0000387
388/**************************************************************************
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000389 * FatalAppExit16 (KERNEL.137)
390 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000391void WINAPI FatalAppExit16( UINT16 action, LPCSTR str )
Alexandre Julliard2787be81995-05-22 18:23:01 +0000392{
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000393 WARN("AppExit\n");
Alexandre Julliarda3960291999-02-26 11:11:13 +0000394 FatalAppExitA( action, str );
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000395}
396
397
398/**************************************************************************
399 * FatalAppExit32A (KERNEL32.108)
400 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000401void WINAPI FatalAppExitA( UINT action, LPCSTR str )
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000402{
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000403 WARN("AppExit\n");
Alexandre Julliarda3960291999-02-26 11:11:13 +0000404 MessageBoxA( 0, str, NULL, MB_SYSTEMMODAL | MB_OK );
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000405 ExitProcess(0);
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000406}
407
408
409/**************************************************************************
410 * FatalAppExit32W (KERNEL32.109)
411 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000412void WINAPI FatalAppExitW( UINT action, LPCWSTR str )
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000413{
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000414 WARN("AppExit\n");
Alexandre Julliarda3960291999-02-26 11:11:13 +0000415 MessageBoxW( 0, str, NULL, MB_SYSTEMMODAL | MB_OK );
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000416 ExitProcess(0);
Alexandre Julliard2787be81995-05-22 18:23:01 +0000417}
Alexandre Julliard349a9531997-02-02 19:01:52 +0000418
419