mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 03:03:16 +00:00
process one command line parameter to open cabinet window
svn path=/trunk/; revision=7302
This commit is contained in:
parent
5a6b27edc4
commit
c1bd24b5d5
2 changed files with 17 additions and 8 deletions
|
@ -120,7 +120,7 @@ ResBitmap::ResBitmap(UINT nid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void explorer_show_frame(HWND hwndDesktop, int cmdshow)
|
void explorer_show_frame(HWND hwndDesktop, int cmdshow, LPTSTR lpCmdLine)
|
||||||
{
|
{
|
||||||
if (g_Globals._hMainWnd)
|
if (g_Globals._hMainWnd)
|
||||||
return;
|
return;
|
||||||
|
@ -136,8 +136,11 @@ void explorer_show_frame(HWND hwndDesktop, int cmdshow)
|
||||||
ShowWindow(hMainFrame, cmdshow);
|
ShowWindow(hMainFrame, cmdshow);
|
||||||
UpdateWindow(hMainFrame);
|
UpdateWindow(hMainFrame);
|
||||||
|
|
||||||
// Open the first child window after initializing the whole application
|
// Open the first child window after initializing the application
|
||||||
PostMessage(hMainFrame, PM_OPEN_WINDOW, OWM_EXPLORE|OWM_DETAILS, 0);
|
if (lpCmdLine)
|
||||||
|
PostMessage(hMainFrame, PM_OPEN_WINDOW, 0, (LPARAM)lpCmdLine);
|
||||||
|
else
|
||||||
|
PostMessage(hMainFrame, PM_OPEN_WINDOW, OWM_EXPLORE|OWM_DETAILS, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +164,7 @@ static void InitInstance(HINSTANCE hInstance)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int explorer_main(HINSTANCE hInstance, HWND hwndDesktop, int cmdshow)
|
int explorer_main(HINSTANCE hInstance, HWND hwndDesktop, LPTSTR lpCmdLine, int cmdshow)
|
||||||
{
|
{
|
||||||
CONTEXT("explorer_main");
|
CONTEXT("explorer_main");
|
||||||
|
|
||||||
|
@ -188,7 +191,7 @@ int explorer_main(HINSTANCE hInstance, HWND hwndDesktop, int cmdshow)
|
||||||
cmdshow = SW_MAXIMIZE;
|
cmdshow = SW_MAXIMIZE;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
explorer_show_frame(hwndDesktop, cmdshow);
|
explorer_show_frame(hwndDesktop, cmdshow, lpCmdLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Window::MessageLoop();
|
return Window::MessageLoop();
|
||||||
|
@ -300,7 +303,13 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = explorer_main(hInstance, hwndDesktop, nShowCmd);
|
/**TODO fix command line handling */
|
||||||
|
if (*lpCmdLine=='"' && lpCmdLine[_tcslen(lpCmdLine)-1]=='"') {
|
||||||
|
++lpCmdLine;
|
||||||
|
lpCmdLine[_tcslen(lpCmdLine)-1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
int ret = explorer_main(hInstance, hwndDesktop, lpCmdLine, nShowCmd);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,10 @@ extern "C" {
|
||||||
extern int startup(int argc, char *argv[]);
|
extern int startup(int argc, char *argv[]);
|
||||||
|
|
||||||
// explorer main routine
|
// explorer main routine
|
||||||
extern int explorer_main(HINSTANCE hinstance, HWND hwndDesktop, int cmdshow);
|
extern int explorer_main(HINSTANCE hinstance, HWND hwndDesktop, LPTSTR lpCmdLine, int cmdshow);
|
||||||
|
|
||||||
// display explorer/file manager window
|
// display explorer/file manager window
|
||||||
extern void explorer_show_frame(HWND hwndDesktop, int cmdshow);
|
extern void explorer_show_frame(HWND hwndDesktop, int cmdshow, LPTSTR lpCmdLine=NULL);
|
||||||
|
|
||||||
// test for already running desktop instance
|
// test for already running desktop instance
|
||||||
extern BOOL IsAnyDesktopRunning();
|
extern BOOL IsAnyDesktopRunning();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue