[PATCH] shell32: RunFileDlg: move strings to resources

=3D?utf-8?q?Miko=3DC5=3D82aj=3D20Zalewski?=3D mikolaj at zalewski.pl
Fri Jun 27 11:16:47 CDT 2008


---
 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 64ca6a7..6d9b6a8 100644
--- a/dlls/shell32/dialogs.c
+++ b/dlls/shell32/dialogs.c
@@ -104,7 +104,7 @@ void WINAPI RunFileDlgW(
         !(template =3D LoadResource(shell32_hInstance, hRes)))
     {
         ERR("Couldn't load SHELL_RUN_DLG resource\n");
-        MessageBoxA(hwndOwner, "Unable to display Run File dialog box (i=
nternal error)", NULL, MB_OK | MB_ICONERROR);
+        ShellMessageBoxW(shell32_hInstance, hwndOwner, MAKEINTRESOURCEW(=
IDS_RUNDLG_ERROR), NULL, MB_OK | MB_ICONERROR);
         return;
     }
=20
@@ -183,16 +183,16 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT=
 message, WPARAM wParam, LPAR
                     LPFNOFN ofnProc =3D NULL ;
                     static const WCHAR comdlg32W[] =3D {'c','o','m','d',=
'l','g','3','2',0};
                     WCHAR szFName[1024] =3D {0};
-                    WCHAR szFilter[MAX_PATH], szCaption[MAX_PATH];
-                    static const char ansiFilter[] =3D "Executable Files=
\0*.exe\0All Files\0*.*\0\0\0\0";
+                    WCHAR *pszFilter, szCaption[MAX_PATH];
                     OPENFILENAMEW ofn;
=20
-                    MultiByteToWideChar(CP_UTF8, 0, ansiFilter, sizeof(a=
nsiFilter), szFilter, MAX_PATH);
-                    MultiByteToWideChar(CP_UTF8, 0, "Browse", -1, szCapt=
ion, MAX_PATH);
+                    LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FIL=
TER, (LPWSTR)&pszFilter, 0);
+                    LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_CAP=
TION, szCaption, MAX_PATH);
+
                     ZeroMemory(&ofn, sizeof(ofn));
                     ofn.lStructSize =3D sizeof(OPENFILENAMEW);
                     ofn.hwndOwner =3D hwnd;
-                    ofn.lpstrFilter =3D szFilter;
+                    ofn.lpstrFilter =3D pszFilter;
                     ofn.lpstrFile =3D szFName;
                     ofn.nMaxFile =3D 1023;
                     ofn.lpstrTitle =3D szCaption;
@@ -202,13 +202,12 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT=
 message, WPARAM wParam, LPAR
                         NULL =3D=3D (ofnProc =3D (LPFNOFN)GetProcAddress=
 (hComdlg, "GetOpenFileNameW")))
                     {
                         ERR("Couldn't get GetOpenFileName function entry=
 (lib=3D%p, proc=3D%p)\n", hComdlg, ofnProc);
-                        MessageBoxA(hwnd, "Unable to display Browse dial=
og box (internal error)", NULL, MB_OK | MB_ICONERROR);
+                        ShellMessageBoxW(shell32_hInstance, hwnd, MAKEIN=
TRESOURCEW(IDS_RUNDLG_BROWSE_ERROR), NULL, MB_OK | MB_ICONERROR);
                         return TRUE ;
                     }
=20
                     if (ofnProc(&ofn))
                     {
-
                         SetFocus (GetDlgItem (hwnd, IDOK)) ;
                         SetWindowTextW (GetDlgItem (hwnd, 12298), szFNam=
e) ;
                         SendMessageW (GetDlgItem (hwnd, 12298), CB_SETED=
ITSEL, 0, MAKELPARAM (0, -1)) ;
diff --git a/dlls/shell32/shell32_En.rc b/dlls/shell32/shell32_En.rc
index 4fa268d..1d44742 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 sessi=
on?"
=20
+        /* Run File dialog */
+        IDS_RUNDLG_ERROR           "Unable to display Run File dialog bo=
x (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 6b9afdd..8099ab5 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=EA programu, katalogu, dokumentu, a Wine otworzy go d=
la ciebie.", 12289, 36, 11, 182, 18
+ LTEXT "Wpisz nazw=EA programu, katalogu lub dokumentu, a Wine otworzy g=
o dla ciebie.", 12289, 36, 11, 182, 18
  LTEXT "&Otw=F3rz:", 12305, 7, 39, 24, 10
  CONTROL "", 12298, "COMBOBOX", WS_TABSTOP | WS_GROUP | WS_VSCROLL | WS_=
VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 1=
83, 100
  DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
@@ -221,6 +221,12 @@ STRINGTABLE
         IDS_SHUTDOWN_TITLE      "Wy=B3=B9cz"
         IDS_SHUTDOWN_PROMPT     "Czy chcesz wy=B3=B9czy=E6 sesj=EA Wine'=
a?"
=20
+        /* Run File dialog */
+        IDS_RUNDLG_ERROR           "Nie mo=BFna wy=9Cwietli=E6 okna dial=
ogowego Uruchom (b=B3=B9d wewn=EAtrzny)"
+        IDS_RUNDLG_BROWSE_ERROR    "Nie mo=BFna wy=9Cwietli=E6 okna dial=
ogowego Przegl=B9daj (b=B3=B9d wewn=EAtrzny)"
+        IDS_RUNDLG_BROWSE_CAPTION  "Przegl=B9daj"
+        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 be404e2..0d71beb 100644
--- a/dlls/shell32/shresdef.h
+++ b/dlls/shell32/shresdef.h
@@ -97,6 +97,11 @@
=20
 #define IDS_NEWFOLDER 142
=20
+#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
=20
--=20
1.5.4


--------------080703010704060100070800--



More information about the wine-patches mailing list