Added Messagebox support.

Patch by Thomas Weidenmueller.

svn path=/trunk/; revision=5301
This commit is contained in:
Eric Kohl 2003-07-28 08:09:51 +00:00
parent 70d7e57a1d
commit 1acf351783
7 changed files with 517 additions and 54 deletions

View file

@ -4919,7 +4919,6 @@ GetScrollRange(
LPINT lpMinPos,
LPINT lpMaxPos);
WINBOOL
STDCALL
ShowScrollBar(
@ -4927,7 +4926,6 @@ ShowScrollBar(
int wBar,
WINBOOL bShow);
WINBOOL
STDCALL
EnableScrollBar(
@ -4935,11 +4933,12 @@ EnableScrollBar(
UINT wSBflags,
UINT wArrows);
BOOL STDCALL GetScrollBarInfo(
HWND hwnd,
LONG idObject,
PSCROLLBARINFO psbi
);
BOOL
STDCALL
GetScrollBarInfo(
HWND hwnd,
LONG idObject,
PSCROLLBARINFO psbi);
WINBOOL
STDCALL
@ -4947,14 +4946,12 @@ GetClientRect(
HWND hWnd,
LPRECT lpRect);
WINBOOL
STDCALL
GetWindowRect(
HWND hWnd,
LPRECT lpRect);
WINBOOL
STDCALL
AdjustWindowRect(
@ -4962,7 +4959,6 @@ AdjustWindowRect(
DWORD dwStyle,
WINBOOL bMenu);
WINBOOL
STDCALL
AdjustWindowRectEx(
@ -4973,33 +4969,36 @@ AdjustWindowRectEx(
WINBOOL
STDCALL
SetWindowContextHelpId(HWND, DWORD);
SetWindowContextHelpId(
HWND hwnd,
DWORD dwContextHelpId);
DWORD
STDCALL
GetWindowContextHelpId(HWND);
GetWindowContextHelpId(
HWND hwnd);
WINBOOL
STDCALL
SetMenuContextHelpId(HMENU, DWORD);
SetMenuContextHelpId(
HMENU hmenu,
DWORD dwContextHelpId);
DWORD
STDCALL
GetMenuContextHelpId(HMENU);
GetMenuContextHelpId(
HMENU hmenu);
WINBOOL
STDCALL
MessageBeep(
UINT uType);
int
STDCALL
ShowCursor(
WINBOOL bShow);
WINBOOL
STDCALL
SetCursorPos(

View file

@ -291,7 +291,7 @@ GetListBoxInfo@4
GetMenu@4
GetMenuBarInfo@16
GetMenuCheckMarkDimensions@0
;GetMenuContextHelpId
GetMenuContextHelpId@4
GetMenuDefaultItem@12
GetMenuInfo@8
GetMenuItemCount@4
@ -345,7 +345,7 @@ GetUserObjectInformationW@20
;GetUserObjectSecurity
;GetWinStationInfo
GetWindow@8
;GetWindowContextHelpId
GetWindowContextHelpId@4
GetWindowDC@4
GetWindowInfo@8
GetWindowLongA@8
@ -574,7 +574,7 @@ SetLastErrorEx@8
SetLayeredWindowAttributes@16
;SetLogonNotifyWindow
SetMenu@8
;SetMenuContextHelpId
SetMenuContextHelpId@8
SetMenuDefaultItem@12
SetMenuInfo@8
SetMenuItemBitmaps@20
@ -607,7 +607,7 @@ SetUserObjectInformationA@16
SetUserObjectInformationW@16
;SetUserObjectSecurity
;SetWinEventHook
;SetWindowContextHelpId
SetWindowContextHelpId@8
SetWindowLongA@12
SetWindowLongW@12
SetWindowPlacement@8

View file

@ -291,7 +291,7 @@ GetListBoxInfo=GetListBoxInfo@4
GetMenu=GetMenu@4
GetMenuBarInfo=GetMenuBarInfo@16
GetMenuCheckMarkDimensions=GetMenuCheckMarkDimensions@0
;GetMenuContextHelpId
GetMenuContextHelpId=GetMenuContextHelpId@4
GetMenuDefaultItem=GetMenuDefaultItem@12
GetMenuInfo=GetMenuInfo@8
GetMenuItemCount=GetMenuItemCount@4
@ -345,7 +345,7 @@ GetUserObjectInformationW=GetUserObjectInformationW@20
;GetUserObjectSecurity
;GetWinStationInfo
GetWindow=GetWindow@8
;GetWindowContextHelpId
GetWindowContextHelpId=GetWindowContextHelpId@4
GetWindowDC=GetWindowDC@4
GetWindowInfo=GetWindowInfo@8
GetWindowLongA=GetWindowLongA@8
@ -574,7 +574,7 @@ SetLastErrorEx=SetLastErrorEx@8
SetLayeredWindowAttributes=SetLayeredWindowAttributes@16
;SetLogonNotifyWindow
SetMenu=SetMenu@8
;SetMenuContextHelpId
SetMenuContextHelpId=SetMenuContextHelpId@8
SetMenuDefaultItem=SetMenuDefaultItem@12
SetMenuInfo=SetMenuInfo@8
SetMenuItemBitmaps=SetMenuItemBitmaps@20
@ -607,7 +607,7 @@ SetUserObjectInformationA=SetUserObjectInformationA@16
SetUserObjectInformationW=SetUserObjectInformationW@16
;SetUserObjectSecurity
;SetWinEventHook
;SetWindowContextHelpId
SetWindowContextHelpId=SetWindowContextHelpId@8
SetWindowLongA=SetWindowLongA@12
SetWindowLongW=SetWindowLongW@12
SetWindowPlacement=SetWindowPlacement@8

View file

@ -16,10 +16,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dialog.c,v 1.13 2003/07/27 17:48:43 ekohl Exp $
/* $Id: dialog.c,v 1.14 2003/07/28 08:09:51 ekohl Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
* FILE: lib/user32/windows/dialog.c
* PURPOSE: Input
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* Thomas Weidenmueller (w3seek@users.sourceforge.net)
@ -776,19 +776,18 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
HeapFree( GetProcessHeap(), 0, dlgInfo );
return 0;
}
/* FIXME: implement SetWindowContextHelpId and enable following line
if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId );
*/
if (unicode)
if (template.helpId)
SetWindowContextHelpId( hwnd, template.helpId );
if (unicode)
{
SETDLGINFO(hwnd, dlgInfo); /* maybe SetPropW? */
SetWindowLongW( hwnd, DWL_DLGPROC, (LONG)dlgProc );
SetWindowLongW( hwnd, DWL_DLGPROC, (LONG)dlgProc );
}
else
{
SETDLGINFO(hwnd, dlgInfo);
SETDLGINFO(hwnd, dlgInfo);
SetWindowLongA( hwnd, DWL_DLGPROC, (LONG)dlgProc );
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: menu.c,v 1.10 2003/07/27 11:54:41 dwelch Exp $
/* $Id: menu.c,v 1.11 2003/07/28 08:09:51 ekohl Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/menu.c
@ -1115,6 +1115,32 @@ TrackPopupMenuEx(
return FALSE;
}
/*
* @unimplemented
*/
WINBOOL
STDCALL
SetMenuContextHelpId(HMENU hmenu,
DWORD dwContextHelpId)
{
UNIMPLEMENTED;
return(FALSE);
}
/*
* @unimplemented
*/
DWORD
STDCALL
GetMenuContextHelpId(HMENU hmenu)
{
UNIMPLEMENTED;
return(0);
}
static BOOL
MenuIsBitmapItem(ULONG TypeData)
{

View file

@ -16,24 +16,366 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: messagebox.c,v 1.7 2003/07/10 21:04:32 chorns Exp $
/* $Id: messagebox.c,v 1.8 2003/07/28 08:09:51 ekohl Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
* FILE: lib/user32/windows/messagebox.c
* PURPOSE: Input
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* Thomas Weidenmueller (w3seek@users.sourceforge.net)
* UPDATE HISTORY:
* 07-27-2003 Code ported from wine
* 09-05-2001 CSH Created
*/
/* INCLUDES ******************************************************************/
#include <windows.h>
#include <messages.h>
#include <user32.h>
#include <string.h>
#include <ntos/rtl.h>
#include <stdio.h>
#include <stdlib.h>
#include <debug.h>
/* DEFINES *******************************************************************/
#define MSGBOX_IDICON 1088
#define MSGBOX_IDTEXT 100
#define IDS_ERROR 2
#define RT_DIALOGA MAKEINTRESOURCEA(5)
#define RT_DIALOGW MAKEINTRESOURCEW(5)
#define IDI_HANDA MAKEINTRESOURCEA(32513)
#define IDI_HANDW MAKEINTRESOURCEW(32513)
#define IDI_QUESTIONA MAKEINTRESOURCEA(32514)
#define IDI_QUESTIONW MAKEINTRESOURCEW(32514)
#define IDI_EXCLAMATIONA MAKEINTRESOURCEA(32515)
#define IDI_EXCLAMATIONW MAKEINTRESOURCEW(32515)
#define IDI_ASTERISKA MAKEINTRESOURCEA(32516)
#define IDI_ASTERISKW MAKEINTRESOURCEW(32516)
#define IDI_WINLOGOA MAKEINTRESOURCEA(32517)
#define IDI_WINLOGOW MAKEINTRESOURCEW(32517)
#ifndef MB_TYPEMASK
#define MB_TYPEMASK 0x0000000F
#endif
#ifndef MB_ICONMASK
#define MB_ICONMASK 0x000000F0
#endif
#ifndef MB_DEFMASK
#define MB_DEFMASK 0x00000F00
#endif
/* FUNCTIONS *****************************************************************/
static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMS lpmb)
{
HFONT hFont = 0, hPrevFont = 0;
RECT rect;
HWND hItem;
HDC hdc;
int i, buttons;
int bspace, bw, bh, theight, tleft, wwidth, wheight, bpos;
int borheight, borwidth, iheight, ileft, iwidth, twidth, tiheight;
LPCWSTR lpszText;
WCHAR buf[256];
NONCLIENTMETRICSW nclm;
nclm.cbSize = sizeof(nclm);
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
hFont = CreateFontIndirectW (&nclm.lfMessageFont);
/* set button font */
for (i=1; i < 8; i++)
SendDlgItemMessageW (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0);
/* set text font */
SendDlgItemMessageW (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0);
if (HIWORD(lpmb->lpszCaption))
{
SetWindowTextW(hwnd, (LPCWSTR)lpmb->lpszCaption);
}
else
{
UINT res_id = LOWORD((UINT)lpmb->lpszCaption); /* FIXME: (UINT) ??? */
if (res_id)
{
if (LoadStringW(lpmb->hInstance, res_id, buf, 256))
SetWindowTextW(hwnd, buf);
}
else
{
if (LoadStringW(GetModuleHandleA("user32.dll"), IDS_ERROR, buf, 256))
SetWindowTextW(hwnd, buf);
}
}
if (HIWORD(lpmb->lpszText))
{
lpszText = (LPCWSTR)lpmb->lpszText;
}
else
{
lpszText = buf;
if (!LoadStringW(lpmb->hInstance, LOWORD((UINT)lpmb->lpszText), buf, 256)) /* FIXME: (UINT) ??? */
*buf = 0; /* FIXME ?? */
}
SetWindowTextW(GetDlgItem(hwnd, MSGBOX_IDTEXT), lpszText);
/* Hide not selected buttons */
switch(lpmb->dwStyle & MB_TYPEMASK) {
case MB_OK:
ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
/* fall through */
case MB_OKCANCEL:
ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
break;
case MB_ABORTRETRYIGNORE:
ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
break;
case MB_YESNO:
ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE);
/* fall through */
case MB_YESNOCANCEL:
ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDRETRY), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
break;
case MB_RETRYCANCEL:
ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDABORT), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDIGNORE), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE);
ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE);
break;
}
/* Set the icon */
switch(lpmb->dwStyle & MB_ICONMASK) {
case MB_ICONEXCLAMATION:
SendDlgItemMessageW(hwnd, 0x0440, STM_SETICON,
(WPARAM)LoadIconW(0, IDI_EXCLAMATIONW), 0);
break;
case MB_ICONQUESTION:
SendDlgItemMessageW(hwnd, 0x0440, STM_SETICON,
(WPARAM)LoadIconW(0, IDI_QUESTIONW), 0);
break;
case MB_ICONASTERISK:
SendDlgItemMessageW(hwnd, 0x0440, STM_SETICON,
(WPARAM)LoadIconW(0, IDI_ASTERISKW), 0);
break;
case MB_ICONHAND:
SendDlgItemMessageW(hwnd, 0x0440, STM_SETICON,
(WPARAM)LoadIconW(0, IDI_HANDW), 0);
break;
case MB_USERICON:
SendDlgItemMessageW(hwnd, 0x0440, STM_SETICON,
(WPARAM)LoadIconW(lpmb->hInstance, (LPCWSTR)lpmb->lpszIcon), 0);
break;
default:
/* By default, Windows 95/98/NT do not associate an icon to message boxes.
* So wine should do the same.
*/
break;
}
/* Position everything */
GetWindowRect(hwnd, &rect);
borheight = rect.bottom - rect.top;
borwidth = rect.right - rect.left;
GetClientRect(hwnd, &rect);
borheight -= rect.bottom - rect.top;
borwidth -= rect.right - rect.left;
/* Get the icon height */
GetWindowRect(GetDlgItem(hwnd, MSGBOX_IDICON), &rect);
MapWindowPoints(0, hwnd, (LPPOINT)&rect, 2);
if (!(lpmb->dwStyle & MB_ICONMASK))
{
rect.bottom = rect.top;
rect.right = rect.left;
}
iheight = rect.bottom - rect.top;
ileft = rect.left;
iwidth = rect.right - ileft;
hdc = GetDC(hwnd);
if (hFont)
hPrevFont = SelectObject(hdc, hFont);
/* Get the number of visible buttons and their size */
bh = bw = 1; /* Minimum button sizes */
for (buttons = 0, i = 1; i < 8; i++)
{
hItem = GetDlgItem(hwnd, i);
if (GetWindowLongW(hItem, GWL_STYLE) & WS_VISIBLE)
{
WCHAR buttonText[1024];
int w, h;
buttons++;
if (GetWindowTextW(hItem, buttonText, 1024))
{
DrawTextW( hdc, buttonText, -1, &rect, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT);
h = rect.bottom - rect.top;
w = rect.right - rect.left;
if (h > bh)
bh = h;
if (w > bw)
bw = w ;
}
}
}
bw = max(bw, bh * 2);
/* Button white space */
bh = bh * 2;
bw = bw * 2;
bspace = bw/3; /* Space between buttons */
/* Get the text size */
GetClientRect(GetDlgItem(hwnd, MSGBOX_IDTEXT), &rect);
rect.top = rect.left = rect.bottom = 0;
DrawTextW( hdc, lpszText, -1, &rect,
DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT);
/* Min text width corresponds to space for the buttons */
tleft = ileft;
if (iwidth)
tleft += ileft + iwidth;
twidth = max((bw + bspace) * buttons + bspace - tleft, rect.right);
theight = rect.bottom;
if (hFont)
SelectObject(hdc, hPrevFont);
ReleaseDC(hItem, hdc);
tiheight = 16 + max(iheight, theight);
wwidth = tleft + twidth + ileft + borwidth;
wheight = 8 + tiheight + bh + borheight;
/* Resize the window */
SetWindowPos(hwnd, 0, 0, 0, wwidth, wheight,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
/* Position the icon */
SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDICON), 0, ileft, (tiheight - iheight) / 2, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
/* Position the text */
SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDTEXT), 0, tleft, (tiheight - theight) / 2, twidth, theight,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
/* Position the buttons */
bpos = (wwidth - (bw + bspace) * buttons + bspace) / 2;
for (buttons = i = 0; i < 7; i++)
{
/* some arithmetic to get the right order for YesNoCancel windows */
hItem = GetDlgItem(hwnd, (i + 5) % 7 + 1);
if (GetWindowLongW(hItem, GWL_STYLE) & WS_VISIBLE)
{
if (buttons++ == ((lpmb->dwStyle & MB_DEFMASK) >> 8))
{
SetFocus(hItem);
SendMessageW( hItem, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
}
SetWindowPos(hItem, 0, bpos, tiheight, bw, bh,
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);
bpos += bw + bspace;
}
}
/* handle modal MessageBoxes */
if (lpmb->dwStyle & (MB_TASKMODAL|MB_SYSTEMMODAL))
{
DbgPrint("%s modal msgbox ! Not modal yet.\n",
lpmb->dwStyle & MB_TASKMODAL ? "task" : "system");
/* Probably do EnumTaskWindows etc. here for TASKMODAL
* and work your way up to the top - I'm lazy (HWND_TOP) */
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE);
if (lpmb->dwStyle & MB_TASKMODAL)
/* at least MB_TASKMODAL seems to imply a ShowWindow */
ShowWindow(hwnd, SW_SHOW);
}
if (lpmb->dwStyle & MB_APPLMODAL)
DbgPrint("app modal msgbox ! Not modal yet.\n");
return hFont;
}
/**************************************************************************
* MSGBOX_DlgProc
*
* Dialog procedure for message boxes.
*/
static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam )
{
HFONT hFont;
switch(message)
{
case WM_INITDIALOG:
{
LPMSGBOXPARAMS mbp = (LPMSGBOXPARAMS)lParam;
SetWindowContextHelpId(hwnd, mbp->dwContextHelpId);
hFont = MSGBOX_OnInit(hwnd, mbp);
SetPropA(hwnd, "ROS_MSGBOX_HFONT", (HANDLE)hFont);
SetPropA(hwnd, "ROS_MSGBOX_HELPCALLBACK", (HANDLE)mbp->lpfnMsgBoxCallback);
break;
}
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
case IDABORT:
case IDRETRY:
case IDIGNORE:
case IDYES:
case IDNO:
hFont = GetPropA(hwnd, "ROS_MSGBOX_HFONT");
EndDialog(hwnd, wParam);
if (hFont)
DeleteObject(hFont);
break;
}
break;
case WM_HELP:
{
MSGBOXCALLBACK callback = (MSGBOXCALLBACK)GetPropA(hwnd, "ROS_MSGBOX_HELPCALLBACK");
HELPINFO hi;
memcpy(&hi, (void *)lParam, sizeof(hi));
hi.dwContextId = GetWindowContextHelpId(hwnd);
if (callback)
callback(&hi);
else
SendMessageW(GetWindow(hwnd, GW_OWNER), WM_HELP, 0, (LPARAM)&hi);
break;
}
default:
/* Ok. Ignore all the other messages */
DbgPrint("Message number 0x%04x is being ignored.\n", message);
break;
}
return 0;
}
/*
* @implemented
*/
@ -45,12 +387,12 @@ MessageBoxA(
LPCSTR lpCaption,
UINT uType)
{
return MessageBoxExA(hWnd, lpText, lpCaption, uType, 0);
return MessageBoxExA(hWnd, lpText, lpCaption, uType, LANG_NEUTRAL);
}
/*
* @unimplemented
* @implemented
*/
int
STDCALL
@ -61,13 +403,25 @@ MessageBoxExA(
UINT uType,
WORD wLanguageId)
{
UNIMPLEMENTED;
return 0;
MSGBOXPARAMS msgbox;
msgbox.cbSize = sizeof(msgbox);
msgbox.hwndOwner = hWnd;
msgbox.hInstance = 0;
msgbox.lpszText = lpText;
msgbox.lpszCaption = lpCaption;
msgbox.dwStyle = uType;
msgbox.lpszIcon = NULL;
msgbox.dwContextHelpId = 0;
msgbox.lpfnMsgBoxCallback = NULL;
msgbox.dwLanguageId = wLanguageId;
return MessageBoxIndirectA(&msgbox);
}
/*
* @unimplemented
* @implemented
*/
int
STDCALL
@ -78,39 +432,102 @@ MessageBoxExW(
UINT uType,
WORD wLanguageId)
{
UNIMPLEMENTED;
return 0;
MSGBOXPARAMS msgbox;
msgbox.cbSize = sizeof(msgbox);
msgbox.hwndOwner = hWnd;
msgbox.hInstance = 0;
msgbox.lpszText = (LPCSTR)lpText;
msgbox.lpszCaption =(LPCSTR) lpCaption;
msgbox.dwStyle = uType;
msgbox.lpszIcon = NULL;
msgbox.dwContextHelpId = 0;
msgbox.lpfnMsgBoxCallback = NULL;
msgbox.dwLanguageId = wLanguageId;
return MessageBoxIndirectW(&msgbox);
}
/*
* @unimplemented
* @implemented
*/
int
STDCALL
MessageBoxIndirectA(
CONST LPMSGBOXPARAMS lpMsgBoxParams)
{
UNIMPLEMENTED;
return 0;
MSGBOXPARAMS msgboxW;
UNICODE_STRING textW, captionW, iconW;
int ret;
if (HIWORD((UINT)lpMsgBoxParams->lpszText))
RtlCreateUnicodeStringFromAsciiz(&textW, (PCSZ)lpMsgBoxParams->lpszText);
else
textW.Buffer = (LPWSTR)lpMsgBoxParams->lpszText;
if (HIWORD((UINT)lpMsgBoxParams->lpszCaption))
RtlCreateUnicodeStringFromAsciiz(&captionW, (PCSZ)lpMsgBoxParams->lpszCaption);
else
captionW.Buffer = (LPWSTR)lpMsgBoxParams->lpszCaption;
if (HIWORD((UINT)lpMsgBoxParams->lpszIcon))
RtlCreateUnicodeStringFromAsciiz(&iconW, (PCSZ)lpMsgBoxParams->lpszIcon);
else
iconW.Buffer = (LPWSTR)lpMsgBoxParams->lpszIcon;
msgboxW.cbSize = sizeof(msgboxW);
msgboxW.hwndOwner = lpMsgBoxParams->hwndOwner;
msgboxW.hInstance = lpMsgBoxParams->hInstance;
msgboxW.lpszText = (LPCSTR)textW.Buffer;
msgboxW.lpszCaption = (LPCSTR)captionW.Buffer;
msgboxW.dwStyle = lpMsgBoxParams->dwStyle;
msgboxW.lpszIcon = (LPCSTR)iconW.Buffer;
msgboxW.dwContextHelpId = lpMsgBoxParams->dwContextHelpId;
msgboxW.lpfnMsgBoxCallback = lpMsgBoxParams->lpfnMsgBoxCallback;
msgboxW.dwLanguageId = lpMsgBoxParams->dwLanguageId;
ret = MessageBoxIndirectW(&msgboxW);
if (HIWORD(textW.Buffer))
RtlFreeUnicodeString(&textW);
if (HIWORD(captionW.Buffer))
RtlFreeUnicodeString(&captionW);
if (HIWORD(iconW.Buffer))
RtlFreeUnicodeString(&iconW);
return ret;
}
/*
* @unimplemented
* @implemented
*/
int
STDCALL
MessageBoxIndirectW(
CONST LPMSGBOXPARAMS lpMsgBoxParams)
{
UNIMPLEMENTED;
return 0;
LPVOID tmplate;
HRSRC hRes;
HMODULE hUser32;
hUser32 = GetModuleHandleW(L"user32.dll");
if (!(hRes = FindResourceExW(hUser32, RT_DIALOGW, L"MSGBOX", lpMsgBoxParams->dwLanguageId)))
return 0;
if (!(tmplate = (LPVOID)LoadResource(hUser32, hRes)))
return 0;
return DialogBoxIndirectParamW(lpMsgBoxParams->hInstance, tmplate, lpMsgBoxParams->hwndOwner,
MSGBOX_DlgProc, (LPARAM)lpMsgBoxParams);
}
/*
* @unimplemented
* @implemented
*/
int
STDCALL
@ -120,7 +537,7 @@ MessageBoxW(
LPCWSTR lpCaption,
UINT uType)
{
return MessageBoxExW(hWnd, lpText, lpCaption, uType, 0);
return MessageBoxExW(hWnd, lpText, lpCaption, uType, LANG_NEUTRAL);
}

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.48 2003/07/27 11:54:41 dwelch Exp $
/* $Id: window.c,v 1.49 2003/07/28 08:09:51 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -1579,7 +1579,7 @@ MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
lpPoints[i].x += XMove;
lpPoints[i].y += YMove;
}
return(MAKELONG(LOWORD(XMove), LOWORD(YMove)));
return(MAKELONG(LOWORD(XMove), LOWORD(YMove)));
}
@ -1602,4 +1602,26 @@ ClientToScreen(HWND hWnd, LPPOINT lpPoint)
return (MapWindowPoints( hWnd, NULL, lpPoint, 1 ));
}
WINBOOL
STDCALL
SetWindowContextHelpId(HWND hwnd,
DWORD dwContextHelpId)
{
UNIMPLEMENTED;
return(FALSE);
}
/*
* @unimplemented
*/
DWORD
STDCALL
GetWindowContextHelpId(HWND hwnd)
{
UNIMPLEMENTED;
return(0);
}
/* EOF */