[FILEBROWSER]
[reactos.git] / base / shell / filebrowser / filebrowser.c
index a3d5dc2..ee5f59e 100644 (file)
 #include <windows.h>
 #include <shobjidl.h>
 #include <shlobj.h>
-
-typedef HRESULT (WINAPI *SH_OPEN_NEW_FRAME)(LPITEMIDLIST pidl, IUnknown *paramC, long param10, long param14);
+#include <shlwapi.h>
+#include <shlwapi_undoc.h>
+#include <stdio.h>
 
 int _tmain(int argc, _TCHAR* argv[])
 {
-    HMODULE hBrowseui = LoadLibraryW(L"browseui.dll");
-    if (hBrowseui)
+    EXPLORER_CMDLINE_PARSE_RESULTS parseResults = { 0 };
+
+    if (SHExplorerParseCmdLine(&parseResults))
     {
-        SH_OPEN_NEW_FRAME SHOpenNewFrame = (SH_OPEN_NEW_FRAME)GetProcAddress(hBrowseui, (LPCSTR)103);
-        LPITEMIDLIST pidlDrives;
-        HRESULT hRet = SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidlDrives);
-        SHOpenNewFrame((LPITEMIDLIST)pidlDrives, NULL, 0, 0);
+        parseResults.dwFlags |= SH_EXPLORER_CMDLINE_FLAG_SEPARATE;
+        return SHCreateFromDesktop(&parseResults);
     }
 
-    /* FIXME: we should wait a bit here and see if a window was created. If not we should exit this process */
-    ExitThread(0);
-
     return 0;
 }
-