Index: boot/bootdata/hivedef_i386.inf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: dll/win32/user32/windows/messagebox.c =================================================================== --- dll/win32/user32/windows/messagebox.c (revision 50896) +++ dll/win32/user32/windows/messagebox.c (working copy) @@ -34,7 +34,12 @@ #include #include +#include +#include +static LPCTSTR s_szRegistryKey = _T("Software\\Microsoft\\User32"); +BOOL UseEditControl; + WINE_DEFAULT_DEBUG_CHANNEL(user32); /* DEFINES *******************************************************************/ @@ -180,6 +185,46 @@ return 0; } +HRESULT RegGetDWord(HKEY hKey, LPCTSTR szValueName, DWORD * lpdwResult) +{ + LONG lResult; + DWORD dwDataSize = sizeof(DWORD); + DWORD dwType = 0; + + // Check input parameters... + if (hKey == NULL || lpdwResult == NULL) return E_INVALIDARG; + + // Get dword value from the registry... + lResult = RegQueryValueEx(hKey, szValueName, 0, &dwType, (LPBYTE) lpdwResult, &dwDataSize ); + + // Check result and make sure the registry value is a DWORD(REG_DWORD)... + if (lResult != ERROR_SUCCESS) return HRESULT_FROM_WIN32(lResult); + else if (dwType != REG_DWORD) return DISP_E_TYPEMISMATCH; + + return NOERROR; +} + +void LoadSettings(void) +{ + HKEY hKey = NULL; + DWORD dwValue; + + if (RegOpenKey(HKEY_CURRENT_USER, s_szRegistryKey, &hKey) == ERROR_SUCCESS) + { + RegGetDWord(hKey, TEXT("blUseEditControl"), &dwValue); + if (dwValue == 1) + { + UseEditControl = TRUE; + } + else + { + UseEditControl = FALSE; + } + + RegCloseKey(hKey); + } +} + static int MessageBoxTimeoutIndirectW( CONST MSGBOXPARAMSW *lpMsgBoxParams, UINT Timeout) @@ -421,11 +466,23 @@ *(WORD*)dest = 0; dest += sizeof(WORD); } + + LoadSettings(); - /* create static for text */ + /* TODO: delete ALL new line characters at the end of the text if ANY. + Create static/edit control for text */ dest = (BYTE*)(((UINT_PTR)dest + 3) & ~3); itxt = (DLGITEMTEMPLATE *)dest; - itxt->style = WS_CHILD | WS_VISIBLE | SS_NOPREFIX; + + if (UseEditControl == TRUE) + { + itxt->style = WS_VISIBLE | ES_READONLY | ES_MULTILINE; + } + else + { + itxt->style = WS_VISIBLE | WS_CHILD | SS_NOPREFIX; + } + if(lpMsgBoxParams->dwStyle & MB_RIGHT) itxt->style |= SS_RIGHT; else @@ -435,14 +492,25 @@ dest += sizeof(DLGITEMTEMPLATE); *(WORD*)dest = 0xFFFF; dest += sizeof(WORD); - *(WORD*)dest = 0x0082; /* static control */ + + if (UseEditControl == TRUE) + { + *(WORD*)dest = 0x0081; /* static control = 0x0082, edit control = 0x0081 */ + } + else + { + *(WORD*)dest = 0x0082; + } + dest += sizeof(WORD); memcpy(dest, text, textlen * sizeof(WCHAR)); dest += textlen * sizeof(WCHAR); *(WCHAR*)dest = 0; dest += sizeof(WCHAR); + *(WCHAR*)dest = '\0'; /* Need to terminate it for static */ *(WORD*)dest = 0; - dest += sizeof(WORD); + dest += sizeof(WORD); + *(WORD*)dest = '\0'; /* Need to terminate it for static */ /* create buttons */ btnsize.cx = BTN_CX; @@ -579,14 +647,24 @@ btnleft = max(btnleft - MSGBOXEX_BUTTONSPACING, rc.left + txtrect.right); btnleft += MSGBOXEX_MARGIN; btntop += btnsize.cy + MSGBOXEX_MARGIN; - /* set size and position of the message static */ + /* set size and position of the message static/edit */ itxt->x = (rc.left * 4) / LOWORD(units); itxt->y = (rc.top * 8) / HIWORD(units); - itxt->cx = (((btnleft - rc.left - MSGBOXEX_MARGIN) * 4) / LOWORD(units)); - itxt->cy = ((txtrect.bottom * 8) / HIWORD(units)); - /* set size of the window */ - tpl->cx = (btnleft * 4) / LOWORD(units); + + if (UseEditControl == TRUE) + { + itxt->cx = ((((btnleft - rc.left - MSGBOXEX_MARGIN) * 4)+50) / LOWORD(units)); /* +50 for edit control */ + /* set size of the window */ + tpl->cx = ((btnleft * 4)+60) / LOWORD(units); /* +60 for edit control */ + } + else + { + itxt->cx = (((btnleft - rc.left - MSGBOXEX_MARGIN) * 4) / LOWORD(units)); + tpl->cx = (btnleft * 4) / LOWORD(units); + } + itxt->cy = ((txtrect.bottom * 8) / HIWORD(units)); tpl->cy = (btntop * 8) / HIWORD(units); + /* finally show the messagebox */ mbi.Icon = Icon;