--- trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2005-04-02 14:16:47 UTC (rev 14440)
+++ trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2005-04-02 14:26:56 UTC (rev 14441)
@@ -40,19 +40,19 @@
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 @@
if (hwndOld)
DestroyWindow(hwndOld);
- ShowWindow(hMainFrame, cmdshow);
- UpdateWindow(hMainFrame);
+ ShowWindow(hFrame, cmdshow);
+ UpdateWindow(hFrame);
bool valid_dir = false;
@@ -78,12 +78,12 @@
// 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(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 @@
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) {
--- trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-04-02 14:16:47 UTC (rev 14440)
+++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-04-02 14:26:56 UTC (rev 14441)
@@ -1861,11 +1861,19 @@
#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));
break;