From bcc6256bf05194dcca411ea17347653f8acd022f Mon Sep 17 00:00:00 2001 From: Jason Edmeades Date: Sat, 4 May 2002 18:29:31 +0000 Subject: [PATCH] Add support for the 'title' command. --- programs/wcmd/builtins.c | 9 +++++++++ programs/wcmd/wcmd.h | 15 ++++++++++----- programs/wcmd/wcmdmain.c | 9 +++++++-- programs/wcmd/wcmdrc.rc | 3 +++ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/programs/wcmd/builtins.c b/programs/wcmd/builtins.c index 00abdfd8d38..ee1539600d0 100644 --- a/programs/wcmd/builtins.c +++ b/programs/wcmd/builtins.c @@ -755,6 +755,15 @@ void WCMD_shift () { } /**************************************************************************** + * WCMD_title + * + * Set the console title + */ +void WCMD_title (char *command) { + SetConsoleTitle(command); +} + +/**************************************************************************** * WCMD_type * * Copy a file to standard output. diff --git a/programs/wcmd/wcmd.h b/programs/wcmd/wcmd.h index 175580d8ab4..7ce15e3ea1b 100644 --- a/programs/wcmd/wcmd.h +++ b/programs/wcmd/wcmd.h @@ -65,6 +65,7 @@ void WCMD_setshow_prompt (void); void WCMD_setshow_time (void); void WCMD_shift (void); void WCMD_show_prompt (void); +void WCMD_title (char *); void WCMD_type (void); void WCMD_verify (char *command); void WCMD_version (void); @@ -126,10 +127,14 @@ typedef struct { #define WCMD_SET 28 #define WCMD_SHIFT 29 #define WCMD_TIME 30 -#define WCMD_TYPE 31 -#define WCMD_VERIFY 32 -#define WCMD_VER 33 -#define WCMD_VOL 34 -#define WCMD_EXIT 35 +#define WCMD_TITLE 31 +#define WCMD_TYPE 32 +#define WCMD_VERIFY 33 +#define WCMD_VER 34 +#define WCMD_VOL 35 + +/* Must be last in list */ +#define WCMD_EXIT 36 + diff --git a/programs/wcmd/wcmdmain.c b/programs/wcmd/wcmdmain.c index e764f75df0f..1bb10431859 100644 --- a/programs/wcmd/wcmdmain.c +++ b/programs/wcmd/wcmdmain.c @@ -30,7 +30,7 @@ char *inbuilt[] = {"ATTRIB", "CALL", "CD", "CHDIR", "CLS", "COPY", "CTTY", "DATE", "DEL", "DIR", "ECHO", "ERASE", "FOR", "GOTO", "HELP", "IF", "LABEL", "MD", "MKDIR", "MOVE", "PATH", "PAUSE", "PROMPT", "REM", "REN", "RENAME", "RD", "RMDIR", "SET", "SHIFT", - "TIME", "TYPE", "VERIFY", "VER", "VOL", "EXIT"}; + "TIME", "TITLE", "TYPE", "VERIFY", "VER", "VOL", "EXIT" }; HINSTANCE hinst; DWORD errorlevel; @@ -77,6 +77,7 @@ HANDLE h; if (!status) WCMD_print_error(); SetConsoleMode (GetStdHandle(STD_INPUT_HANDLE), ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT); + SetConsoleTitle("Wine Command Prompt"); /* * Execute any command-line options. @@ -306,7 +307,11 @@ char *whichcmd; break; case WCMD_TIME: WCMD_setshow_time (); - break; + break; + case WCMD_TITLE: + if (strlen(&whichcmd[count]) > 0) + WCMD_title(&whichcmd[count+1]); + break; case WCMD_TYPE: WCMD_type (); break; diff --git a/programs/wcmd/wcmdrc.rc b/programs/wcmd/wcmdrc.rc index b3883e2b145..486ec999681 100644 --- a/programs/wcmd/wcmdrc.rc +++ b/programs/wcmd/wcmdrc.rc @@ -168,6 +168,8 @@ if called from the command line.\n" WCMD_TIME, "Help about TIME\n" + WCMD_TITLE, "Sets the window title for the wcmd window, syntax TITLE [string]" + WCMD_TYPE, "TYPE copies to the console device (or elsewhere\ if redirected). No check is made that the file is readable text.\n" @@ -210,6 +212,7 @@ REN (RENAME)\tRename a file\ RD (RMDIR)\tDelete a subdirectory\ SET\t\tSet or show environment variables\ TIME\t\tSet or show the current system time\ +TITLE\t\tSet the window title for the WCMD session\ TYPE\t\tType the contents of a text file\ VER\t\tShow the current version of WCMD\ VOL\t\tShow the volume label of a disk device\ -- 2.11.4.GIT