From 87c424ef42ba99f3521137b9c267aaf08a32467c Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 2 Apr 2005 14:26:56 +0000 Subject: [PATCH] reactivate control panel folder svn path=/trunk/; revision=14441 --- .../system/explorer/shell/mainframe.cpp | 56 ++++++++++++------- .../subsys/system/explorer/shell/mainframe.h | 1 + .../system/explorer/taskbar/startmenu.cpp | 14 ++++- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index 1efd2d2a087..f9439fa54bf 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -40,19 +40,19 @@ extern HWND create_webchildwindow(const WebChildWndInfo& info); HWND MainFrameBase::Create(LPCTSTR path, bool mdi, UINT cmdshow) { - HWND hMainFrame; + HWND hFrame; #ifndef _NO_MDI ///@todo implement command line option to switch between MDI and SDI if (mdi) - hMainFrame = MDIMainFrame::Create(); + hFrame = MDIMainFrame::Create(); else #endif - hMainFrame = SDIMainFrame::Create(); + hFrame = SDIMainFrame::Create(); - if (hMainFrame) { + if (hFrame) { HWND hwndOld = g_Globals._hMainWnd; - g_Globals._hMainWnd = hMainFrame; + g_Globals._hMainWnd = hFrame; if (path) { static String sPath = path; // copy path to avoid accessing freed memory @@ -62,8 +62,8 @@ HWND MainFrameBase::Create(LPCTSTR path, bool mdi, UINT cmdshow) if (hwndOld) DestroyWindow(hwndOld); - ShowWindow(hMainFrame, cmdshow); - UpdateWindow(hMainFrame); + ShowWindow(hFrame, cmdshow); + UpdateWindow(hFrame); bool valid_dir = false; @@ -78,12 +78,12 @@ HWND MainFrameBase::Create(LPCTSTR path, bool mdi, UINT cmdshow) // Open the first child window after initializing the application if (valid_dir) - PostMessage(hMainFrame, PM_OPEN_WINDOW, 0, (LPARAM)path); + PostMessage(hFrame, PM_OPEN_WINDOW, 0, (LPARAM)path); else - PostMessage(hMainFrame, PM_OPEN_WINDOW, OWM_EXPLORE|OWM_DETAILS, 0); + PostMessage(hFrame, PM_OPEN_WINDOW, OWM_EXPLORE|OWM_DETAILS, 0); } - return hMainFrame; + return hFrame; } @@ -842,34 +842,34 @@ HWND MDIMainFrame::Create() HWND MDIMainFrame::Create(LPCTSTR path, int mode) { - HWND hMainFrame = Create(); - if (!hMainFrame) + HWND hFrame = Create(); + if (!hFrame) return 0; - ShowWindow(hMainFrame, SW_SHOW); + ShowWindow(hFrame, SW_SHOW); - MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hMainFrame); + MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame); if (pMainFrame) pMainFrame->CreateChild(path, mode); - return hMainFrame; + return hFrame; } HWND MDIMainFrame::Create(LPCITEMIDLIST pidl, int mode) { - HWND hMainFrame = Create(); - if (!hMainFrame) + HWND hFrame = Create(); + if (!hFrame) return 0; - ShowWindow(hMainFrame, SW_SHOW); + ShowWindow(hFrame, SW_SHOW); - MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hMainFrame); + MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame); if (pMainFrame) pMainFrame->CreateChild(pidl, mode); - return hMainFrame; + return hFrame; } @@ -1315,6 +1315,22 @@ HWND SDIMainFrame::Create(LPCITEMIDLIST pidl, int mode) return hFrame; } +HWND SDIMainFrame::Create(LPCTSTR path, int mode) +{ + HWND hFrame = Create(); + if (!hFrame) + return 0; + + ShowWindow(hFrame, SW_SHOW); + + MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame); + + if (pMainFrame) + pMainFrame->CreateChild(path, mode); + + return hFrame; +} + LRESULT SDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) { switch(nmsg) { diff --git a/reactos/subsys/system/explorer/shell/mainframe.h b/reactos/subsys/system/explorer/shell/mainframe.h index 5cdc3206ce5..f8e02cdf0fc 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.h +++ b/reactos/subsys/system/explorer/shell/mainframe.h @@ -135,6 +135,7 @@ struct SDIMainFrame : public ExtContextMenuHandlerT< SDIMainFrame(HWND hwnd); static HWND Create(); + static HWND Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS); static HWND Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL); protected: diff --git a/reactos/subsys/system/explorer/taskbar/startmenu.cpp b/reactos/subsys/system/explorer/taskbar/startmenu.cpp index 6868ad18596..d48452d3c78 100644 --- a/reactos/subsys/system/explorer/taskbar/startmenu.cpp +++ b/reactos/subsys/system/explorer/taskbar/startmenu.cpp @@ -1861,10 +1861,18 @@ int StartMenuHandler::Command(int id, int code) #endif break; - case IDC_CONTROL_PANEL: + case IDC_CONTROL_PANEL: { CloseStartMenu(id); - //@@SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0); - break; +#ifndef _NO_MDI + XMLPos explorer_options = g_Globals.get_cfg("general/explorer"); + bool mdi = XMLBool(explorer_options, "mdi", true); + + if (mdi) + MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0); + else +#endif + SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0); + break;} case IDC_ADMIN: CreateSubmenu(id, CSIDL_COMMON_ADMINTOOLS, CSIDL_ADMINTOOLS, ResString(IDS_ADMIN));