+
+
+
+INT CommandWindow (LPTSTR cmd, LPTSTR param)
+{
+ HWND h;
+
+ if (_tcsncmp (param, _T("/?"), 2) == 0)
+ {
+ ConOutPuts(_T("change console window aspect\n"
+ "\n"
+ "WINDOW [/POS[=]left,top,width,heigth]\n"
+ " [MIN|MAX|RESTORE] [\"title\"]\n"
+ "\n"
+ "/POS specify window placement and dimensions\n"
+ "MIN minimize the window\n"
+ "MAX maximize the window\n"
+ "RESTORE restore the window"));
+ return 0;
+ }
+
+ h = GetConsoleWindow();
+ Sleep(0);
+ return ServiceActivate(param,h);
+}
+
+
+INT CommandActivate (LPTSTR cmd, LPTSTR param)
+{
+ LPTSTR str;
+ HWND h;
+
+ if (_tcsncmp (param, _T("/?"), 2) == 0)
+ {
+ ConOutPuts(_T("change console window aspect\n"
+ "\n"
+ "ACTIAVTE \"window\" [/POS[=]left,top,width,heigth]\n"
+ " [MIN|MAX|RESTORE] [\"title\"]\n"
+ "\n"
+ "window tile of window on wich perform actions\n"
+ "/POS specify window placement and dimensions\n"
+ "MIN minimize the window\n"
+ "MAX maximize the window\n"
+ "RESTORE restore the window\n"
+ "title new title"));
+ return 0;
+ }
+
+ if(!(*param))
+ return 1;
+
+ str=_tcschr(param,_T(' '));
+
+ if (str)
+ {
+ *str=_T('\0');
+ str++;
+ }
+ else
+ str = "";
+
+ h=FindWindow(NULL, param);
+ if (!h)
+ {
+ ConErrPuts("window not found");
+ return 1;
+ }
+
+ return ServiceActivate(str,h);
+}
+
+#endif /* ( defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE) ) */
\ No newline at end of file