Mikołaj Zalewski : shell32: RunFileDlg: use symbolic constants for control IDs and use correct hInstance when creating it .

Alexandre Julliard julliard at winehq.org
Mon Jun 30 08:27:03 CDT 2008


Module: wine
Branch: master
Commit: 13866e81f7e39f5219d6ffaee110305087ec849a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=13866e81f7e39f5219d6ffaee110305087ec849a

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Fri Jun 27 17:28:57 2008 +0200

shell32: RunFileDlg: use symbolic constants for control IDs and use correct hInstance when creating it.

---

 dlls/shell32/dialogs.c     |   11 +++++------
 dlls/shell32/shell32_En.rc |    4 ++--
 dlls/shell32/shresdef.h    |    4 ++++
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c
index cb0e870..034768f 100644
--- a/dlls/shell32/dialogs.c
+++ b/dlls/shell32/dialogs.c
@@ -111,8 +111,7 @@ void WINAPI RunFileDlgW(
         return;
         }
 
-    DialogBoxIndirectParamW((HINSTANCE)GetWindowLongPtrW( hwndOwner,
-						       GWLP_HINSTANCE ),
+    DialogBoxIndirectParamW(shell32_hInstance,
 			    template, hwndOwner, RunDlgProc, (LPARAM)&rfdp);
 
 }
@@ -130,8 +129,8 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
             SetClassLongPtrW (hwnd, GCLP_HICON, (LPARAM)prfdp->hIcon) ;
             SendMessageW (GetDlgItem (hwnd, 12297), STM_SETICON,
                           (WPARAM)LoadIconW (NULL, (LPCWSTR)IDI_WINLOGO), 0);
-            FillList (GetDlgItem (hwnd, 12298), NULL) ;
-            SetFocus (GetDlgItem (hwnd, 12298)) ;
+            FillList (GetDlgItem (hwnd, IDC_RUNDLG_EDITPATH), NULL) ;
+            SetFocus (GetDlgItem (hwnd, IDC_RUNDLG_EDITPATH)) ;
             return TRUE ;
 
         case WM_COMMAND :
@@ -140,7 +139,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
                 case IDOK :
                     {
                     int ic ;
-                    HWND htxt = GetDlgItem (hwnd, 12298); /* edit control */
+                    HWND htxt = GetDlgItem (hwnd, IDC_RUNDLG_EDITPATH);
                     if ((ic = GetWindowTextLengthW (htxt)))
                         {
                         WCHAR *psz ;
@@ -181,7 +180,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
                     EndDialog (hwnd, 0) ;
                     return TRUE ;
 
-                case 12288 :
+                case IDC_RUNDLG_BROWSE :
                     {
                     HMODULE hComdlg = NULL ;
                     LPFNOFN ofnProc = NULL ;
diff --git a/dlls/shell32/shell32_En.rc b/dlls/shell32/shell32_En.rc
index 112d033..4fa268d 100644
--- a/dlls/shell32/shell32_En.rc
+++ b/dlls/shell32/shell32_En.rc
@@ -159,10 +159,10 @@ FONT 8, "MS Shell Dlg"
  ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
  LTEXT "Type the name of a program, folder, document, or Internet resource, and Wine will open it for you.", 12289, 36, 11, 182, 18
  LTEXT "&Open:", 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
+ CONTROL "", IDC_RUNDLG_EDITPATH, "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
  PUSHBUTTON "Cancel", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
- PUSHBUTTON "&Browse...", 12288, 170, 63, 50, 14, WS_TABSTOP
+ PUSHBUTTON "&Browse...", IDC_RUNDLG_BROWSE, 170, 63, 50, 14, WS_TABSTOP
 }
 
 STRINGTABLE
diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h
index cb11a80..be404e2 100644
--- a/dlls/shell32/shresdef.h
+++ b/dlls/shell32/shresdef.h
@@ -172,4 +172,8 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi
 #define IDC_ABOUT_STATIC_TEXT2   101
 #define IDC_ABOUT_STATIC_TEXT3   102
 
+/* run dialog */
+#define IDC_RUNDLG_BROWSE       12288
+#define IDC_RUNDLG_EDITPATH     12298
+
 #endif




More information about the wine-cvs mailing list