mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
reactivate control panel folder
svn path=/trunk/; revision=14441
This commit is contained in:
parent
ce4cbf5e57
commit
87c424ef42
3 changed files with 48 additions and 23 deletions
|
@ -40,19 +40,19 @@ extern HWND create_webchildwindow(const WebChildWndInfo& info);
|
||||||
|
|
||||||
HWND MainFrameBase::Create(LPCTSTR path, bool mdi, UINT cmdshow)
|
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
|
#ifndef _NO_MDI ///@todo implement command line option to switch between MDI and SDI
|
||||||
if (mdi)
|
if (mdi)
|
||||||
hMainFrame = MDIMainFrame::Create();
|
hFrame = MDIMainFrame::Create();
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
hMainFrame = SDIMainFrame::Create();
|
hFrame = SDIMainFrame::Create();
|
||||||
|
|
||||||
if (hMainFrame) {
|
if (hFrame) {
|
||||||
HWND hwndOld = g_Globals._hMainWnd;
|
HWND hwndOld = g_Globals._hMainWnd;
|
||||||
|
|
||||||
g_Globals._hMainWnd = hMainFrame;
|
g_Globals._hMainWnd = hFrame;
|
||||||
|
|
||||||
if (path) {
|
if (path) {
|
||||||
static String sPath = path; // copy path to avoid accessing freed memory
|
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)
|
if (hwndOld)
|
||||||
DestroyWindow(hwndOld);
|
DestroyWindow(hwndOld);
|
||||||
|
|
||||||
ShowWindow(hMainFrame, cmdshow);
|
ShowWindow(hFrame, cmdshow);
|
||||||
UpdateWindow(hMainFrame);
|
UpdateWindow(hFrame);
|
||||||
|
|
||||||
bool valid_dir = false;
|
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
|
// Open the first child window after initializing the application
|
||||||
if (valid_dir)
|
if (valid_dir)
|
||||||
PostMessage(hMainFrame, PM_OPEN_WINDOW, 0, (LPARAM)path);
|
PostMessage(hFrame, PM_OPEN_WINDOW, 0, (LPARAM)path);
|
||||||
else
|
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 MDIMainFrame::Create(LPCTSTR path, int mode)
|
||||||
{
|
{
|
||||||
HWND hMainFrame = Create();
|
HWND hFrame = Create();
|
||||||
if (!hMainFrame)
|
if (!hFrame)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ShowWindow(hMainFrame, SW_SHOW);
|
ShowWindow(hFrame, SW_SHOW);
|
||||||
|
|
||||||
MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hMainFrame);
|
MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
|
||||||
|
|
||||||
if (pMainFrame)
|
if (pMainFrame)
|
||||||
pMainFrame->CreateChild(path, mode);
|
pMainFrame->CreateChild(path, mode);
|
||||||
|
|
||||||
return hMainFrame;
|
return hFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWND MDIMainFrame::Create(LPCITEMIDLIST pidl, int mode)
|
HWND MDIMainFrame::Create(LPCITEMIDLIST pidl, int mode)
|
||||||
{
|
{
|
||||||
HWND hMainFrame = Create();
|
HWND hFrame = Create();
|
||||||
if (!hMainFrame)
|
if (!hFrame)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ShowWindow(hMainFrame, SW_SHOW);
|
ShowWindow(hFrame, SW_SHOW);
|
||||||
|
|
||||||
MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hMainFrame);
|
MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
|
||||||
|
|
||||||
if (pMainFrame)
|
if (pMainFrame)
|
||||||
pMainFrame->CreateChild(pidl, mode);
|
pMainFrame->CreateChild(pidl, mode);
|
||||||
|
|
||||||
return hMainFrame;
|
return hFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1315,6 +1315,22 @@ HWND SDIMainFrame::Create(LPCITEMIDLIST pidl, int mode)
|
||||||
return hFrame;
|
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)
|
LRESULT SDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||||
{
|
{
|
||||||
switch(nmsg) {
|
switch(nmsg) {
|
||||||
|
|
|
@ -135,6 +135,7 @@ struct SDIMainFrame : public ExtContextMenuHandlerT<
|
||||||
SDIMainFrame(HWND hwnd);
|
SDIMainFrame(HWND hwnd);
|
||||||
|
|
||||||
static HWND Create();
|
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);
|
static HWND Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -1861,10 +1861,18 @@ int StartMenuHandler::Command(int id, int code)
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IDC_CONTROL_PANEL:
|
case IDC_CONTROL_PANEL: {
|
||||||
CloseStartMenu(id);
|
CloseStartMenu(id);
|
||||||
//@@SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
|
#ifndef _NO_MDI
|
||||||
break;
|
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:
|
case IDC_ADMIN:
|
||||||
CreateSubmenu(id, CSIDL_COMMON_ADMINTOOLS, CSIDL_ADMINTOOLS, ResString(IDS_ADMIN));
|
CreateSubmenu(id, CSIDL_COMMON_ADMINTOOLS, CSIDL_ADMINTOOLS, ResString(IDS_ADMIN));
|
||||||
|
|
Loading…
Reference in a new issue