strip extended options from the front of the command line
Modified: trunk/reactos/subsys/system/explorer/explorer.cpp
_____
Modified: trunk/reactos/subsys/system/explorer/explorer.cpp
--- trunk/reactos/subsys/system/explorer/explorer.cpp 2005-10-05
23:05:13 UTC (rev 18284)
+++ trunk/reactos/subsys/system/explorer/explorer.cpp 2005-10-05
23:24:25 UTC (rev 18285)
@@ -856,8 +856,19 @@
BOOL startup_desktop;
+ // strip extended options from the front of the command line
+ String ext_options;
+
+ while(*lpCmdLine == '-') {
+ while(*lpCmdLine && !_istspace((unsigned)*lpCmdLine))
+ ext_options += *lpCmdLine++;
+
+ while(_istspace((unsigned)*lpCmdLine))
+ ++lpCmdLine;
+ }
+
// command line option "-install" to replace previous shell
application with ROS Explorer
- if (_tcsstr(lpCmdLine,TEXT("-install"))) {
+ if (_tcsstr(ext_options,TEXT("-install"))) {
// install ROS Explorer into the registry
TCHAR path[MAX_PATH];
@@ -921,24 +932,24 @@
#endif
// If there is given the command line option "-desktop", create
desktop window anyways
- if (_tcsstr(lpCmdLine,TEXT("-desktop")))
+ if (_tcsstr(ext_options,TEXT("-desktop")))
startup_desktop = TRUE;
#ifndef ROSSHELL
- else if (_tcsstr(lpCmdLine,TEXT("-nodesktop")))
+ else if (_tcsstr(ext_options,TEXT("-nodesktop")))
startup_desktop = FALSE;
// Don't display cabinet window in desktop mode
- if (startup_desktop && !_tcsstr(lpCmdLine,TEXT("-explorer")))
+ if (startup_desktop && !_tcsstr(ext_options,TEXT("-explorer")))
nShowCmd = SW_HIDE;
#endif
- if (_tcsstr(lpCmdLine,TEXT("-noautostart")))
+ if (_tcsstr(ext_options,TEXT("-noautostart")))
autostart = false;
- else if (_tcsstr(lpCmdLine,TEXT("-autostart")))
+ else if (_tcsstr(ext_options,TEXT("-autostart")))
autostart = true;
#ifndef __WINE__
- if (_tcsstr(lpCmdLine,TEXT("-console"))) {
+ if (_tcsstr(ext_options,TEXT("-console"))) {
AllocConsole();
_dup2(_open_osfhandle((long)GetStdHandle(STD_INPUT_HANDLE), _O_RDONLY),
0);
@@ -974,10 +985,10 @@
bool use_gdb_stub = false; // !IsDebuggerPresent();
- if (_tcsstr(lpCmdLine,TEXT("-debug")))
+ if (_tcsstr(ext_options,TEXT("-debug")))
use_gdb_stub = true;
- if (_tcsstr(lpCmdLine,TEXT("-break"))) {
+ if (_tcsstr(ext_options,TEXT("-break"))) {
LOG(TEXT("debugger breakpoint"));
#ifdef _MSC_VER
__asm int 3
leave TrackStartmenu() function when executing any start menu command
Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp
_____
Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp
--- trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp
2005-10-05 19:50:48 UTC (rev 18280)
+++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp
2005-10-05 19:51:08 UTC (rev 18281)
@@ -311,7 +311,7 @@
break;
case WM_MOVE: {
- POINTS& pos = MAKEPOINTS(lparam);
+ const POINTS& pos = MAKEPOINTS(lparam);
// move open submenus of floating menus
if (_submenu) {
@@ -1623,13 +1623,13 @@
ShowWindow(hwnd, SW_SHOW);
SetForegroundWindow(hwnd);
- while(IsWindow(hwnd)) {
+ while(IsWindow(hwnd) && IsWindowVisible(hwnd)) {
if (!GetMessage(&msg, 0, 0, 0)) {
PostQuitMessage(msg.wParam);
break;
}
- // Check for a mouse click on any window, which is not
part of the start menu
+ // Check for a mouse click on any window, that is not
part of the start menu
if (msg.message==WM_LBUTTONDOWN ||
msg.message==WM_MBUTTONDOWN || msg.message==WM_RBUTTONDOWN) {
StartMenu* menu_wnd = NULL;
use GET_X_LPARAM macro in WM_MOUSEMOVE handlers
Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp
Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp
_____
Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp
--- trunk/reactos/subsys/system/explorer/shell/mainframe.cpp
2005-10-05 19:48:29 UTC (rev 18278)
+++ trunk/reactos/subsys/system/explorer/shell/mainframe.cpp
2005-10-05 19:49:37 UTC (rev 18279)
@@ -1466,7 +1466,7 @@
case WM_MOUSEMOVE:
if (GetCapture() == _hwnd) {
- int x = LOWORD(lparam);
+ int x = GET_X_LPARAM(lparam);
ClientRect rt(_hwnd);
_____
Modified: trunk/reactos/subsys/system/explorer/utility/window.cpp
--- trunk/reactos/subsys/system/explorer/utility/window.cpp
2005-10-05 19:48:29 UTC (rev 18278)
+++ trunk/reactos/subsys/system/explorer/utility/window.cpp
2005-10-05 19:49:37 UTC (rev 18279)
@@ -472,7 +472,7 @@
case WM_MOUSEMOVE:
if (GetCapture() == _hwnd) {
- int x = LOWORD(lparam);
+ int x = GET_X_LPARAM(lparam);
ClientRect rt(_hwnd);