mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
additional comments
svn path=/trunk/; revision=5601
This commit is contained in:
@@ -136,7 +136,16 @@ LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||
|
||||
case WM_CREATE: {
|
||||
HRESULT hr = Desktop()->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);
|
||||
/* also possible:
|
||||
SFV_CREATE sfv_create;
|
||||
|
||||
sfv_create.cbSize = sizeof(SFV_CREATE);
|
||||
sfv_create.pshf = Desktop();
|
||||
sfv_create.psvOuter = NULL;
|
||||
sfv_create.psfvcb = NULL;
|
||||
|
||||
HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView);
|
||||
*/
|
||||
HWND hWndView = 0;
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
@@ -150,7 +159,7 @@ LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||
|
||||
hr = _pShellView->CreateViewWindow(NULL, &fs, this, &rect, &hWndView);
|
||||
|
||||
//TODO: use IShellBrowser::GetViewStateStream() to restore previous view state
|
||||
//TODO: use IShellBrowser::GetViewStateStream() to restore previous view state -> see SHOpenRegStream()
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
_pShellView->UIActivate(SVUIA_ACTIVATE_FOCUS);
|
||||
|
||||
@@ -146,16 +146,18 @@ int explorer_main(HINSTANCE hinstance, HWND hwndParent, int cmdshow)
|
||||
|
||||
InitInstance(hinstance);
|
||||
|
||||
#ifndef _ROS_ // don't maximize if being called from the ROS desktop
|
||||
if (cmdshow == SW_SHOWNORMAL)
|
||||
/*TODO: read window placement from registry */
|
||||
cmdshow = SW_MAXIMIZE;
|
||||
#endif
|
||||
|
||||
if (hwndParent)
|
||||
g_Globals._desktop_mode = true;
|
||||
|
||||
explorer_show_frame(hwndParent, cmdshow);
|
||||
if (cmdshow != SW_HIDE) {
|
||||
#ifndef _ROS_ // don't maximize if being called from the ROS desktop
|
||||
if (cmdshow == SW_SHOWNORMAL)
|
||||
/*TODO: read window placement from registry */
|
||||
cmdshow = SW_MAXIMIZE;
|
||||
#endif
|
||||
|
||||
explorer_show_frame(hwndParent, cmdshow);
|
||||
}
|
||||
|
||||
while(GetMessage(&msg, 0, 0, 0)) {
|
||||
if (g_Globals._hMainWnd && SendMessage(g_Globals._hMainWnd, WM_TRANSLATE_MSG, 0, (LPARAM)&msg))
|
||||
@@ -190,6 +192,11 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
||||
if (!lstrcmp(lpCmdLine,TEXT("-desktop")))
|
||||
startup_desktop = TRUE;
|
||||
|
||||
if (!lstrcmp(lpCmdLine,TEXT("-noexplorer"))) {
|
||||
nShowCmd = SW_HIDE;
|
||||
startup_desktop = TRUE;
|
||||
}
|
||||
|
||||
HWND hwndDesktop = 0;
|
||||
|
||||
if (startup_desktop)
|
||||
@@ -197,7 +204,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
||||
hwndDesktop = create_desktop_window(hInstance);
|
||||
|
||||
// Initialize the explorer bar
|
||||
HWND hwndExplorerBar = InitializeExplorerBar(hInstance, nShowCmd);
|
||||
HWND hwndExplorerBar = InitializeExplorerBar(hInstance);
|
||||
|
||||
// Load plugins
|
||||
LoadAvailablePlugIns(hwndExplorerBar);
|
||||
|
||||
@@ -47,7 +47,7 @@ extern HWND create_desktop_window(HINSTANCE hInstance);
|
||||
extern BOOL IsAnyDesktopRunning();
|
||||
|
||||
// start desktop bar
|
||||
extern HWND InitializeExplorerBar(HINSTANCE hInstance, int nCmdShow);
|
||||
extern HWND InitializeExplorerBar(HINSTANCE hInstance);
|
||||
|
||||
// load plugins
|
||||
extern int LoadAvailablePlugIns(HWND ExplWnd);
|
||||
|
||||
@@ -193,20 +193,27 @@ void ShellBrowserChild::Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPO
|
||||
HWND hwndParent = ::GetParent(hwndTreeView);
|
||||
Entry* entry = (Entry*)itemData;
|
||||
|
||||
IShellFolder* folder;
|
||||
IShellFolder* shell_folder;
|
||||
ShellDirectory* dir;
|
||||
|
||||
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
folder = static_cast<ShellDirectory*>(entry)->_folder;
|
||||
else
|
||||
folder = entry->_up? static_cast<ShellDirectory*>(entry->_up)->_folder: Desktop();
|
||||
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
dir = static_cast<ShellDirectory*>(entry);
|
||||
shell_folder = dir->_folder;
|
||||
} else {
|
||||
dir = static_cast<ShellDirectory*>(entry->_up);
|
||||
shell_folder = dir? dir->_folder: Desktop();
|
||||
}
|
||||
|
||||
folder->AddRef();
|
||||
shell_folder->AddRef();
|
||||
|
||||
if (folder) {
|
||||
if (shell_folder) {
|
||||
LPCITEMIDLIST pidl = static_cast<ShellEntry*>(entry)->_pidl;
|
||||
|
||||
IContextMenu* pcm;
|
||||
HRESULT hr = folder->GetUIObjectOf(hwndParent, 1, &pidl, IID_IContextMenu, NULL, (LPVOID*)&pcm);
|
||||
|
||||
HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm);
|
||||
|
||||
// HRESULT hr = shell_folder->GetUIObjectOf(hwndParent, 1, &pidl, IID_IContextMenu, NULL, (LPVOID*)&pcm);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
HMENU hPopup = CreatePopupMenu();
|
||||
@@ -251,7 +258,7 @@ void ShellBrowserChild::Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPO
|
||||
pcm->Release();
|
||||
}
|
||||
|
||||
folder->Release();
|
||||
shell_folder->Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ DWORD LoadProperty(int PInt)
|
||||
}
|
||||
|
||||
// Initialize and create the Explorer Panel
|
||||
HWND InitializeExplorerBar(HINSTANCE hInstance, int nCmdShow)
|
||||
HWND InitializeExplorerBar(HINSTANCE hInstance)
|
||||
{
|
||||
HWND ExplorerBar;
|
||||
WNDCLASS ExplorerBarClass;
|
||||
@@ -99,7 +99,7 @@ HWND InitializeExplorerBar(HINSTANCE hInstance, int nCmdShow)
|
||||
ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
|
||||
DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Timmons");
|
||||
|
||||
ShowWindow(ExplorerBar, nCmdShow); // Show the bar
|
||||
ShowWindow(ExplorerBar, SW_SHOW); // Show the bar
|
||||
|
||||
return ExplorerBar;
|
||||
}
|
||||
@@ -338,7 +338,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
|
||||
// Initializing the Explorer Bar !
|
||||
//
|
||||
|
||||
if (!(ExplHnd=InitializeExplorerBar(hInstance, nCmdShow)))
|
||||
if (!(ExplHnd=InitializeExplorerBar(hInstance)))
|
||||
{
|
||||
fprintf(stderr,"FATAL : Explorer bar could not be initialized properly ! Exiting !\n");
|
||||
return 1;
|
||||
|
||||
@@ -190,7 +190,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
||||
#endif
|
||||
|
||||
// Initializing the Explorer Bar
|
||||
if (!(hwndExplorerBar=InitializeExplorerBar(hInstance, nShowCmd)))
|
||||
if (!(hwndExplorerBar=InitializeExplorerBar(hInstance)))
|
||||
{
|
||||
fprintf(stderr,"FATAL: Explorer bar could not be initialized properly ! Exiting !\n");
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user