fix errors in "activate". Change activate, window, and msgbox commands from checking for __REACTOS__ to NT4_INTERNAL_COMMAND. they are turned off by default(uncomment line 23 to enable).

svn path=/trunk/; revision=18552
This commit is contained in:
Brandon Turner 2005-10-18 13:32:32 +00:00
parent b8674b8084
commit 5c00cee958
2 changed files with 20 additions and 17 deletions

View file

@ -20,6 +20,8 @@
#define WIN32_LEAN_AND_MEAN
//#define NT4_INTERNAL_COMMANDS
/* Define to enable the alias command, and aliases.*/
#define FEATURE_ALIASES
@ -51,7 +53,7 @@
/* #define LOCALE_GERMAN */ /* German locale */
/* #define LOCALE_DEFAULT */ /* United States locale */
#ifndef __REACTOS__
#ifdef NT4_INTERNAL_COMMANDS
#define INCLUDE_CMD_ACTIVATE
#endif
#define INCLUDE_CMD_ATTRIB
@ -70,7 +72,7 @@
#define INCLUDE_CMD_MEMORY
#define INCLUDE_CMD_MKDIR
#define INCLUDE_CMD_MOVE
#ifndef __REACTOS__
#ifdef NT4_INTERNAL_COMMANDS
#define INCLUDE_CMD_MSGBOX
#endif
#define INCLUDE_CMD_PATH
@ -90,7 +92,7 @@
#define INCLUDE_CMD_BEEP
#define INCLUDE_CMD_VERIFY
#define INCLUDE_CMD_VOL
#ifndef __REACTOS__
#ifdef NT4_INTERNAL_COMMANDS
#define INCLUDE_CMD_WINDOW
#endif

View file

@ -49,8 +49,7 @@ static INT ServiceActivate (LPTSTR param, HWND hWnd)
if (*param)
p = split(param, &argc);
p = split(param, &argc, FALSE);
for (i = 0; i < argc; i++)
{
@ -187,7 +186,7 @@ INT CommandWindow (LPTSTR cmd, LPTSTR param)
return 0;
}
h = GetConsoleWindow();
hwnd = GetConsoleWindow();
Sleep(0);
return ServiceActivate(param, hwnd);
}
@ -195,8 +194,9 @@ INT CommandWindow (LPTSTR cmd, LPTSTR param)
INT CommandActivate (LPTSTR cmd, LPTSTR param)
{
LPTSTR str;
HWND hwnd;
LPTSTR *arg;
INT argc;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
@ -207,24 +207,25 @@ INT CommandActivate (LPTSTR cmd, LPTSTR param)
if(!(*param))
return 1;
str=_tcschr(param,_T(' '));
if (str)
/*Split the user input into array*/
arg = split (param, &argc, FALSE);
if(argc < 2)
{
*str=_T('\0');
str++;
if(arg != NULL)
freep(arg);
}
else
str = "";
hwnd = FindWindow(NULL, param);
hwnd = FindWindow(NULL, arg[0]);
if (hwnd == NULL)
{
if(arg != NULL)
freep(arg);
ConErrResPuts(STRING_WINDOW_ERROR1);
return 1;
}
if(arg != NULL)
freep(arg);
return ServiceActivate(str, hwnd);
return ServiceActivate(param, hwnd);
}
#endif /* ( defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE) ) */