[PATCH] shell32: move language-dependent string from Run > Brows=

=3D?utf-8?q?Miko=3DC5=3D82aj=3D20Zalewski?=3D mikolaj at zalewski.pl
Thu Jun 19 13:02:31 CDT 2008


e to resources

---
 dlls/shell32/dialogs.c     |   48 ++++++++++++++++++++++++--------------=
-----
 dlls/shell32/shell32_En.rc |    5 ++++
 dlls/shell32/shell32_Pl.rc |    5 ++++
 dlls/shell32/shresdef.h    |    4 +++
 4 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c
index fd401b5..8c5b414 100644
--- a/dlls/shell32/dialogs.c
+++ b/dlls/shell32/dialogs.c
@@ -49,7 +49,7 @@ typedef struct
 	UINT uFlags ;
     } RUNFILEDLGPARAMS ;
=20
-typedef BOOL (*WINAPI LPFNOFN) (OPENFILENAMEA *) ;
+typedef BOOL (*WINAPI LPFNOFN) (OPENFILENAMEW *) ;
=20
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 static INT_PTR CALLBACK RunDlgProc (HWND, UINT, WPARAM, LPARAM) ;
@@ -178,22 +178,23 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT=
 message, WPARAM wParam, LPAR
                     {
                     HMODULE hComdlg =3D NULL ;
                     LPFNOFN ofnProc =3D NULL ;
-                    char szFName[1024] =3D "", szFileTitle[256] =3D "", =
szInitDir[768] =3D "" ;
-                    OPENFILENAMEA ofn =3D
+                    WCHAR szFName[1024] =3D {0} ;
+                    WCHAR *filter, title[64] ;
+                    OPENFILENAMEW ofn =3D
                         {
-                        sizeof (OPENFILENAMEA),
+                        sizeof (OPENFILENAMEW),
                         NULL,
                         NULL,
-                        "Executable Files\0*.exe\0All Files\0*.*\0\0\0\0=
",
+                        NULL,  /* filter - loaded from resource */
                         NULL,
                         0,
                         0,
                         szFName,
                         1023,
-                        szFileTitle,
-                        255,
-                        (LPCSTR)szInitDir,
-                        "Browse",
+                        NULL,
+                        0,
+                        NULL,  /* FIXME: should that be prfdp->lpstrDire=
ctory? */
+                        NULL,  /* title - loaded from resource */
                         OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_HIDER=
EADONLY | OFN_PATHMUSTEXIST,
                         0,
                         0,
@@ -203,25 +204,30 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT=
 message, WPARAM wParam, LPAR
                         NULL
                         } ;
=20
+                    LoadStringW(shell32_hInstance, IDS_RUN_BROWSE_TITLE,=
 title, 64);
+                    LoadStringW(shell32_hInstance, IDS_RUN_BROWSE_FILTER=
, (LPWSTR)&filter, 0);
                     ofn.hwndOwner =3D hwnd ;
+                    ofn.lpstrTitle =3D title;
+                    ofn.lpstrFilter =3D filter;
=20
-                    if (NULL =3D=3D (hComdlg =3D LoadLibraryExA ("comdlg=
32", NULL, 0)))
-                        {
-                        MessageBoxA (hwnd, "Unable to display dialog box=
 (LoadLibraryEx) !", "Nix", MB_OK | MB_ICONEXCLAMATION) ;
-                        return TRUE ;
-                        }
-
-                    if (NULL =3D=3D (ofnProc =3D (LPFNOFN)GetProcAddress=
 (hComdlg, "GetOpenFileNameA")))
-                        {
-                        MessageBoxA (hwnd, "Unable to display dialog box=
 (GetProcAddress) !", "Nix", MB_OK | MB_ICONEXCLAMATION) ;
+                    if (NULL =3D=3D (hComdlg =3D LoadLibraryExA ("comdlg=
32", NULL, 0)) ||
+                        NULL =3D=3D (ofnProc =3D (LPFNOFN)GetProcAddress=
 (hComdlg, "GetOpenFileNameW")))
+                    {
+                        WCHAR msg[MAX_PATH];
+                        LoadStringW(shell32_hInstance, IDS_RUN_BROWSE_ER=
ROR, msg, MAX_PATH);
+                        MessageBoxW (hwnd, msg, NULL, MB_OK | MB_ICONEXC=
LAMATION) ;
+                        if (hComdlg =3D=3D NULL)
+                            ERR("Couldn't load comdlg32.dll\n");
+                        else
+                            ERR("GetProcAddress(GetOpenFileName) failed\=
n");
                         return TRUE ;
-                        }
+                    }
=20
                     ofnProc (&ofn) ;
=20
                     SetFocus (GetDlgItem (hwnd, IDOK)) ;
-                    SetWindowTextA (GetDlgItem (hwnd, 12298), szFName) ;
-                    SendMessageA (GetDlgItem (hwnd, 12298), CB_SETEDITSE=
L, 0, MAKELPARAM (0, -1)) ;
+                    SetWindowTextW (GetDlgItem (hwnd, 12298), szFName) ;
+                    SendMessageW (GetDlgItem (hwnd, 12298), CB_SETEDITSE=
L, 0, MAKELPARAM (0, -1)) ;
                     SetFocus (GetDlgItem (hwnd, IDOK)) ;
=20
                     FreeLibrary (hComdlg) ;
diff --git a/dlls/shell32/shell32_En.rc b/dlls/shell32/shell32_En.rc
index e2f476a..6fe199a 100644
--- a/dlls/shell32/shell32_En.rc
+++ b/dlls/shell32/shell32_En.rc
@@ -219,6 +219,11 @@ STRINGTABLE
         IDS_SHUTDOWN_TITLE      "Shutdown"
         IDS_SHUTDOWN_PROMPT     "Do you want to shutdown your Wine sessi=
on?"
=20
+        /* Run > Browse dialog*/
+        IDS_RUN_BROWSE_TITLE    "Browse"
+        IDS_RUN_BROWSE_FILTER   "Executable Files\0*.exe\0All Files\0*.*=
\0\0"
+        IDS_RUN_BROWSE_ERROR    "Internal error - unable to display dial=
og box"
+
         /* 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 4d29d6f..a38a248 100644
--- a/dlls/shell32/shell32_Pl.rc
+++ b/dlls/shell32/shell32_Pl.rc
@@ -220,6 +220,11 @@ STRINGTABLE
         IDS_SHUTDOWN_TITLE      "Wy=B3=B9cz"
         IDS_SHUTDOWN_PROMPT     "Czy chcesz wy=B3=B9czy=E6 sesj=EA Wine'=
a?"
=20
+        /* Run > Browse dialog*/
+        IDS_RUN_BROWSE_TITLE    "Przegl=B9daj"
+        IDS_RUN_BROWSE_FILTER   "Pliki wykonywalne\0*.exe\0Wszystkie pli=
ki\0*.*\0\0"
+        IDS_RUN_BROWSE_ERROR    "B=B3=B9d wewn=EAtrzny - nie mo=BFna wy=9C=
wietli=E6 okna dialogowego"                               =20
+
         /* 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 24373b7..00c5a89 100644
--- a/dlls/shell32/shresdef.h
+++ b/dlls/shell32/shresdef.h
@@ -96,6 +96,10 @@
=20
 #define IDS_NEWFOLDER 142
=20
+#define IDS_RUN_BROWSE_TITLE        160
+#define IDS_RUN_BROWSE_FILTER       161
+#define IDS_RUN_BROWSE_ERROR        162
+
 #define IDS_LICENSE                 256
 #define IDS_LICENSE_CAPTION         257
=20
--=20
1.5.4


--------------040209040500030300060700--



More information about the wine-patches mailing list