explorer: Use the command line arguments.

This commit is contained in:
Jay Yang 2011-06-11 17:42:21 -04:00 committed by Alexandre Julliard
parent f2ac486e21
commit fd1bdb14a4
1 changed files with 31 additions and 1 deletions

View File

@ -160,6 +160,36 @@ static void register_explorer_window_class(void)
RegisterClassExW(&window_class);
}
static IShellFolder* get_starting_shell_folder(parameters_struct* params)
{
IShellFolder* desktop,*folder;
LPITEMIDLIST root_pidl;
HRESULT hres;
SHGetDesktopFolder(&desktop);
if(!params->root || (strlenW(params->root)==0))
{
return desktop;
}
hres = IShellFolder_ParseDisplayName(desktop,NULL,NULL,
params->root,NULL,
&root_pidl,NULL);
if(FAILED(hres))
{
return desktop;
}
hres = IShellFolder_BindToObject(desktop,root_pidl,NULL,
&IID_IShellFolder,
(void**)&folder);
if(FAILED(hres))
{
return desktop;
}
IShellFolder_Release(desktop);
return folder;
}
static int copy_path_string(LPWSTR target, LPWSTR source)
{
INT i = 0;
@ -290,7 +320,7 @@ int WINAPI wWinMain(HINSTANCE hinstance,
ExitProcess(EXIT_FAILURE);
}
register_explorer_window_class();
SHGetDesktopFolder(&folder);
folder = get_starting_shell_folder(&parameters);
make_explorer_window(folder);
IShellFolder_Release(folder);
while(GetMessageW( &msg, NULL, 0, 0 ) != 0)