Vincent Povirk : shell32: Use ShellExecuteEx instead of ShellExecute in the run dialog.

Alexandre Julliard julliard at winehq.org
Fri Dec 19 11:19:35 CST 2008


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Thu Dec 18 15:18:47 2008 -0600

shell32: Use ShellExecuteEx instead of ShellExecute in the run dialog.

---

 dlls/shell32/dialogs.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c
index 0fdc951..a7f056a 100644
--- a/dlls/shell32/dialogs.c
+++ b/dlls/shell32/dialogs.c
@@ -211,19 +211,27 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
                     if ((ic = GetWindowTextLengthW (htxt)))
                         {
                         WCHAR *psz, *parent=NULL ;
-                        LPCWSTR working_dir ;
+                        SHELLEXECUTEINFOW sei ;
+
+                        ZeroMemory (&sei, sizeof(sei)) ;
+                        sei.cbSize = sizeof(sei) ;
                         psz = HeapAlloc( GetProcessHeap(), 0, (ic + 1)*sizeof(WCHAR) );
                         GetWindowTextW (htxt, psz, ic + 1) ;
 
                         /* according to http://www.codeproject.com/KB/shell/runfiledlg.aspx we should send a
                          * WM_NOTIFY before execution */
 
+                        sei.hwnd = hwnd;
+                        sei.nShow = SW_SHOWNORMAL;
+                        sei.lpFile = psz;
+                        sei.fMask = SEE_MASK_FLAG_NO_UI;
+
                         if (prfdp->lpstrDirectory)
-                            working_dir = prfdp->lpstrDirectory;
+                            sei.lpDirectory = prfdp->lpstrDirectory;
                         else
-                            working_dir = parent = RunDlg_GetParentDir(psz);
+                            sei.lpDirectory = parent = RunDlg_GetParentDir(sei.lpFile);
 
-                        if (ShellExecuteW(hwnd, NULL, psz, NULL, working_dir, SW_SHOWNORMAL) < (HINSTANCE)33)
+                        if (ShellExecuteExW( &sei ) < 33)
                             {
                             char *pszSysMsg = NULL ;
                             char szMsg[256];




More information about the wine-cvs mailing list