explorer: Try ShellExecute if the parameter isn't a directory.

This commit is contained in:
Jay Yang 2011-08-29 04:15:00 -04:00 committed by Alexandre Julliard
parent 7023964865
commit c268c40fdf
2 changed files with 5 additions and 1 deletions
programs/explorer

View File

@ -2,7 +2,7 @@ EXTRADEFS = -DWINE_NO_UNICODE_MACROS
MODULE = explorer.exe
APPMODE = -mwindows -municode
IMPORTS = rpcrt4 user32 gdi32 advapi32
DELAYIMPORTS = comctl32 shell32 ole32
DELAYIMPORTS = comctl32 shell32 ole32 shlwapi
C_SRCS = \
appbar.c \

View File

@ -32,6 +32,7 @@
#include <windows.h>
#include <shobjidl.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <commoncontrols.h>
#include <commctrl.h>
@ -755,6 +756,9 @@ int WINAPI wWinMain(HINSTANCE hinstance,
WINE_ERR("Could not initialize COM\n");
ExitProcess(EXIT_FAILURE);
}
if(parameters.root[0] && !PathIsDirectoryW(parameters.root))
if(ShellExecuteW(NULL,NULL,parameters.root,NULL,NULL,SW_SHOWDEFAULT) > (HINSTANCE)32)
ExitProcess(EXIT_SUCCESS);
init_info.dwSize = sizeof(INITCOMMONCONTROLSEX);
init_info.dwICC = ICC_USEREX_CLASSES | ICC_BAR_CLASSES | ICC_COOL_CLASSES;
if(!InitCommonControlsEx(&init_info))