From 0e2b5c76055db9527fefafbb082c456ea974e6d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Miko=C5=82aj=20Zalewski?= Date: Fri, 27 Jun 2008 18:16:47 +0200 Subject: [PATCH] shell32: RunFileDlg: move strings to resources. --- dlls/shell32/dialogs.c | 15 +++++++-------- dlls/shell32/shell32_En.rc | 6 ++++++ dlls/shell32/shell32_Pl.rc | 8 +++++++- dlls/shell32/shresdef.h | 5 +++++ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 367a40a7e9..7941a3e6b5 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -104,7 +104,7 @@ void WINAPI RunFileDlgW( !(template = LoadResource(shell32_hInstance, hRes))) { ERR("Couldn't load SHELL_RUN_DLG resource\n"); - MessageBoxA(hwndOwner, "Unable to display Run File dialog box (internal error)", NULL, MB_OK | MB_ICONERROR); + ShellMessageBoxW(shell32_hInstance, hwndOwner, MAKEINTRESOURCEW(IDS_RUNDLG_ERROR), NULL, MB_OK | MB_ICONERROR); return; } @@ -183,16 +183,16 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR LPFNOFN ofnProc = NULL ; static const WCHAR comdlg32W[] = {'c','o','m','d','l','g','3','2',0}; WCHAR szFName[1024] = {0}; - WCHAR szFilter[MAX_PATH], szCaption[MAX_PATH]; - static const char ansiFilter[] = "Executable Files\0*.exe\0All Files\0*.*\0\0\0\0"; + WCHAR *pszFilter, szCaption[MAX_PATH]; OPENFILENAMEW ofn; - MultiByteToWideChar(CP_UTF8, 0, ansiFilter, sizeof(ansiFilter), szFilter, MAX_PATH); - MultiByteToWideChar(CP_UTF8, 0, "Browse", -1, szCaption, MAX_PATH); + LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER, (LPWSTR)&pszFilter, 0); + LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_CAPTION, szCaption, MAX_PATH); + ZeroMemory(&ofn, sizeof(ofn)); ofn.lStructSize = sizeof(OPENFILENAMEW); ofn.hwndOwner = hwnd; - ofn.lpstrFilter = szFilter; + ofn.lpstrFilter = pszFilter; ofn.lpstrFile = szFName; ofn.nMaxFile = 1023; ofn.lpstrTitle = szCaption; @@ -202,13 +202,12 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR NULL == (ofnProc = (LPFNOFN)GetProcAddress (hComdlg, "GetOpenFileNameW"))) { ERR("Couldn't get GetOpenFileName function entry (lib=%p, proc=%p)\n", hComdlg, ofnProc); - MessageBoxA(hwnd, "Unable to display Browse dialog box (internal error)", NULL, MB_OK | MB_ICONERROR); + ShellMessageBoxW(shell32_hInstance, hwnd, MAKEINTRESOURCEW(IDS_RUNDLG_BROWSE_ERROR), NULL, MB_OK | MB_ICONERROR); return TRUE ; } if (ofnProc(&ofn)) { - SetFocus (GetDlgItem (hwnd, IDOK)) ; SetWindowTextW (GetDlgItem (hwnd, 12298), szFName) ; SendMessageW (GetDlgItem (hwnd, 12298), CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; diff --git a/dlls/shell32/shell32_En.rc b/dlls/shell32/shell32_En.rc index 4fa268d9f6..1d44742360 100644 --- a/dlls/shell32/shell32_En.rc +++ b/dlls/shell32/shell32_En.rc @@ -220,6 +220,12 @@ STRINGTABLE IDS_SHUTDOWN_TITLE "Shutdown" IDS_SHUTDOWN_PROMPT "Do you want to shutdown your Wine session?" + /* Run File dialog */ + IDS_RUNDLG_ERROR "Unable to display Run File dialog box (internal error)" + IDS_RUNDLG_BROWSE_ERROR "Unable to display Browse dialog box (internal error)" + IDS_RUNDLG_BROWSE_CAPTION "Browse" + IDS_RUNDLG_BROWSE_FILTER "Executable Files\0*.exe\0All Files\0*.*\0\0" + /* shell folder path default values */ IDS_PROGRAMS "Start Menu\\Programs" IDS_PERSONAL "My Documents" diff --git a/dlls/shell32/shell32_Pl.rc b/dlls/shell32/shell32_Pl.rc index 6b9afdd3f1..8099ab557b 100644 --- a/dlls/shell32/shell32_Pl.rc +++ b/dlls/shell32/shell32_Pl.rc @@ -158,7 +158,7 @@ CAPTION "" FONT 8, "MS Shell Dlg" { ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE - LTEXT "Wpisz nazwê programu, katalogu, dokumentu, a Wine otworzy go dla ciebie.", 12289, 36, 11, 182, 18 + LTEXT "Wpisz nazwê programu, katalogu lub dokumentu, a Wine otworzy go dla ciebie.", 12289, 36, 11, 182, 18 LTEXT "&Otwórz:", 12305, 7, 39, 24, 10 CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100 DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP @@ -221,6 +221,12 @@ STRINGTABLE IDS_SHUTDOWN_TITLE "Wy³¹cz" IDS_SHUTDOWN_PROMPT "Czy chcesz wy³¹czyæ sesjê Wine'a?" + /* Run File dialog */ + IDS_RUNDLG_ERROR "Nie mo¿na wyœwietliæ okna dialogowego Uruchom (b³¹d wewnêtrzny)" + IDS_RUNDLG_BROWSE_ERROR "Nie mo¿na wyœwietliæ okna dialogowego Przegl¹daj (b³¹d wewnêtrzny)" + IDS_RUNDLG_BROWSE_CAPTION "Przegl¹daj" + IDS_RUNDLG_BROWSE_FILTER "Pliki wykonywalne\0*.exe\0Wszystkie pliki\0*.*\0\0" + /* shell folder path default values */ IDS_PROGRAMS "Menu Start\\Programy" IDS_PERSONAL "Moje dokumenty" diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h index be404e2298..0d71beb59d 100644 --- a/dlls/shell32/shresdef.h +++ b/dlls/shell32/shresdef.h @@ -97,6 +97,11 @@ #define IDS_NEWFOLDER 142 +#define IDS_RUNDLG_ERROR 160 +#define IDS_RUNDLG_BROWSE_ERROR 161 +#define IDS_RUNDLG_BROWSE_CAPTION 162 +#define IDS_RUNDLG_BROWSE_FILTER 163 + #define IDS_LICENSE 256 #define IDS_LICENSE_CAPTION 257 -- 2.32.0.93.g670b81a890