[EXPLORER]

* Rename the output to explorer_old

[EXPLORER-NEW]
* Rename the output to explorer
* Launch a browseui window when explorer is run with an existing shell process.

Shell-experiments will now be running the new shell by default.
This allows me to test the shell classes under more accurate conditions, so I was using it locally for a while.
I decided to commit because of two reasons:
1. It was making me temporarily revert some changes done to some files when I wanted to commit, and
2. It lets everyone see the results of the shell-experiments project without having to mess with the task manager.

Keep in mind that, as the branch name implies, it STILL is an experiment.

CORE-7586

svn path=/branches/shell-experiments/; revision=62449
This commit is contained in:
David Quintana 2014-03-07 22:39:49 +00:00
parent 2ca6b95aeb
commit 51b0371f34
7 changed files with 130 additions and 16 deletions

View file

@ -19,10 +19,10 @@ list(APPEND SOURCE
traywnd.c traywnd.c
precomp.h) precomp.h)
add_executable(explorer_new ${SOURCE} explorer.rc) add_executable(explorer ${SOURCE} explorer.rc)
target_link_libraries(explorer_new uuid) target_link_libraries(explorer uuid)
set_module_type(explorer_new win32gui UNICODE) set_module_type(explorer win32gui UNICODE)
add_importlibs(explorer_new add_importlibs(explorer
advapi32 advapi32
gdi32 gdi32
user32 user32
@ -37,5 +37,5 @@ add_importlibs(explorer_new
msvcrt msvcrt
kernel32 kernel32
ntdll) ntdll)
add_pch(explorer_new precomp.h SOURCE) add_pch(explorer precomp.h SOURCE)
add_cd_file(TARGET explorer_new DESTINATION reactos FOR all) add_cd_file(TARGET explorer DESTINATION reactos FOR all)

View file

@ -381,6 +381,8 @@ _tWinMain(IN HINSTANCE hInstance,
HANDLE hShellDesktop = NULL; HANDLE hShellDesktop = NULL;
BOOL CreateShellDesktop = FALSE; BOOL CreateShellDesktop = FALSE;
DbgPrint("Explorer starting... Commandline: %S\n", lpCmdLine);
if (RegOpenKey(HKEY_CURRENT_USER, if (RegOpenKey(HKEY_CURRENT_USER,
TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"), TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"),
&hkExplorer) != ERROR_SUCCESS) &hkExplorer) != ERROR_SUCCESS)
@ -442,10 +444,109 @@ _tWinMain(IN HINSTANCE hInstance,
} }
else else
{ {
WCHAR root[MAX_PATH];
HMODULE hBrowseui;
HRESULT hr;
LPSHELLFOLDER pDesktopFolder = NULL;
LPITEMIDLIST pidlRoot = NULL;
/* A shell is already loaded. Parse the command line arguments /* A shell is already loaded. Parse the command line arguments
and unless we need to do something specific simply display and unless we need to do something specific simply display
the desktop in a separate explorer window */ the desktop in a separate explorer window */
/* FIXME */ /* FIXME */
/* Commandline switches:
*
* /n Open a new window, even if an existing one still exists.
* /e Start with the explorer sidebar shown.
* /root,<object> Open a window for the given object path.
* /select,<object> Open a window with the given object selected.
*/
/* FIXME: Do it right */
WCHAR* tmp = wcsstr(lpCmdLine,L"/root,");
if (tmp)
{
WCHAR* tmp2;
tmp += 6; // skip to beginning of path
tmp2 = wcschr(tmp, L',');
if (tmp2)
{
wcsncpy(root, tmp, tmp2 - tmp);
}
else
{
wcscpy(root, tmp);
}
}
else
{
wcscpy(root, lpCmdLine);
}
if (root[0] == L'"')
{
int len = wcslen(root) - 2;
wcsncpy(root, root + 1, len);
root[len] = 0;
}
if (wcslen(root) > 0)
{
LPITEMIDLIST pidl;
ULONG chEaten;
ULONG dwAttributes;
if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
{
hr = pDesktopFolder->lpVtbl->ParseDisplayName(pDesktopFolder,
NULL,
NULL,
root,
&chEaten,
&pidl,
&dwAttributes);
if (SUCCEEDED(hr))
{
pidlRoot = pidl;
DbgPrint("Got PIDL for folder '%S'\n", root);
}
}
}
if (!pidlRoot)
{
DbgPrint("No folder, getting PIDL for My Computer.\n", root);
hr = SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidlRoot);
if (FAILED(hr))
return 0;
}
DbgPrint("Trying to open browser window... \n");
typedef HRESULT(WINAPI *SH_OPEN_NEW_FRAME)(LPITEMIDLIST pidl, IUnknown *paramC, long param10, long param14);
SH_OPEN_NEW_FRAME SHOpenNewFrame;
hBrowseui = LoadLibraryW(L"browseui.dll");
if (!hBrowseui)
{
DbgPrint("Browseui not found.. \n");
return 0;
}
SHOpenNewFrame = (SH_OPEN_NEW_FRAME) GetProcAddress(hBrowseui, (LPCSTR) 103);
hr = SHOpenNewFrame(pidlRoot, (IUnknown*)pDesktopFolder, 0, 0);
if (FAILED(hr))
return 0;
/* FIXME: we should wait a bit here and see if a window was created. If not we should exit this process. */
Sleep(1000);
ExitThread(0);
return 0;
} }
if (Tray != NULL) if (Tray != NULL)

View file

@ -46,17 +46,17 @@ if(ARCH STREQUAL "i386")
list(APPEND I386_SOURCE i386-stub-win32.c) list(APPEND I386_SOURCE i386-stub-win32.c)
endif() endif()
add_executable(explorer add_executable(explorer_old
${SOURCE} ${SOURCE}
${I386_SOURCE} ${I386_SOURCE}
services/startup.c services/startup.c
explorer.rc) explorer.rc)
target_link_libraries(explorer comsupp wine uuid) target_link_libraries(explorer_old comsupp wine uuid)
set_module_type(explorer win32gui UNICODE) set_module_type(explorer_old win32gui UNICODE)
add_importlibs(explorer advapi32 gdi32 user32 ws2_32 msimg32 comctl32 ole32 oleaut32 shell32 shlwapi notifyhook msvcrt kernel32 ntdll) add_importlibs(explorer_old advapi32 gdi32 user32 ws2_32 msimg32 comctl32 ole32 oleaut32 shell32 shlwapi notifyhook msvcrt kernel32 ntdll)
add_pch(explorer precomp.h SOURCE) add_pch(explorer_old precomp.h SOURCE)
add_dependencies(explorer psdk) add_dependencies(explorer_old psdk)
add_cd_file(TARGET explorer DESTINATION reactos FOR all) add_cd_file(TARGET explorer_old DESTINATION reactos FOR all)
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/explorer-cfg-template.xml DESTINATION reactos FOR all) add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/explorer-cfg-template.xml DESTINATION reactos FOR all)

View file

@ -11,4 +11,5 @@ add_importlibs(filebrowser
shell32 shell32
msvcrt msvcrt
kernel32) kernel32)
add_cd_file(TARGET explorer DESTINATION reactos FOR all)add_cd_file(TARGET explorer DESTINATION reactos FOR all)

View file

@ -33,7 +33,7 @@ int _tmain(int argc, _TCHAR* argv[])
{ {
SH_OPEN_NEW_FRAME SHOpenNewFrame = (SH_OPEN_NEW_FRAME)GetProcAddress(hBrowseui, (LPCSTR)103); SH_OPEN_NEW_FRAME SHOpenNewFrame = (SH_OPEN_NEW_FRAME)GetProcAddress(hBrowseui, (LPCSTR)103);
LPITEMIDLIST pidlDrives; LPITEMIDLIST pidlDrives;
HRESULT hRet = SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidlDrives); SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidlDrives);
SHOpenNewFrame((LPITEMIDLIST)pidlDrives, NULL, 0, 0); SHOpenNewFrame((LPITEMIDLIST)pidlDrives, NULL, 0, 0);
} }

View file

@ -47,7 +47,13 @@ add_cd_file(TARGET rshell DESTINATION reactos FOR all)
add_custom_command(TARGET rshell POST_BUILD add_custom_command(TARGET rshell POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:rshell>" "$<TARGET_FILE:rshell>"
"$<TARGET_FILE_DIR:explorer_new>/$<TARGET_FILE_NAME:rshell>" "$<TARGET_FILE_DIR:explorer>/$<TARGET_FILE_NAME:rshell>"
COMMENT "Copying to output directory")
add_custom_command(TARGET rshell POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:rshell>"
"$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:rshell>"
COMMENT "Copying to output directory") COMMENT "Copying to output directory")
add_custom_command(TARGET rshell POST_BUILD add_custom_command(TARGET rshell POST_BUILD

View file

@ -65,3 +65,9 @@ add_custom_command(TARGET browseui POST_BUILD
"$<TARGET_FILE:browseui>" "$<TARGET_FILE:browseui>"
"$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>" "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>"
COMMENT "Copying to output directory") COMMENT "Copying to output directory")
add_custom_command(TARGET browseui POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:browseui>"
"$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>"
COMMENT "Copying to output directory")