Jay Yang : explorer: Use the command line arguments.

Alexandre Julliard julliard at winehq.org
Thu Jun 16 14:28:50 CDT 2011


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

Author: Jay Yang <jkelleyy at gmail.com>
Date:   Sat Jun 11 17:42:21 2011 -0400

explorer: Use the command line arguments.

---

 programs/explorer/explorer.c |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c
index 91347eb..6411c16 100644
--- a/programs/explorer/explorer.c
+++ b/programs/explorer/explorer.c
@@ -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)




More information about the wine-cvs mailing list