Damjan Jovanovic : cmd.exe: If there is a title given through STARTUPINFO, use it.

Alexandre Julliard julliard at winehq.org
Mon Aug 19 15:35:12 CDT 2019


Module: wine
Branch: master
Commit: ada8b1ab9387f0ee2a6b96ce7c468934ef3d86c0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ada8b1ab9387f0ee2a6b96ce7c468934ef3d86c0

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Sun Aug 11 16:28:33 2019 +0200

cmd.exe: If there is a title given through STARTUPINFO, use it.

Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/cmd/wcmdmain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 29e498a..d7c0ce1 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -2417,6 +2417,7 @@ int wmain (int argc, WCHAR *argvW[])
   CMD_LIST *toExecute = NULL;         /* Commands left to be executed */
   OSVERSIONINFOW osv;
   char osver[50];
+  STARTUPINFOW startupInfo;
 
   if (!GetEnvironmentVariableW(comspecW, comspec, ARRAY_SIZE(comspec)))
   {
@@ -2676,7 +2677,11 @@ int wmain (int argc, WCHAR *argvW[])
       return errorlevel;
   }
 
-  SetConsoleTitleW(WCMD_LoadMessage(WCMD_CONSTITLE));
+  GetStartupInfoW(&startupInfo);
+  if (startupInfo.lpTitle != NULL)
+      SetConsoleTitleW(startupInfo.lpTitle);
+  else
+      SetConsoleTitleW(WCMD_LoadMessage(WCMD_CONSTITLE));
 
   /* Note: cmd.exe /c dir does not get a new color, /k dir does */
   if (opt_t) {




More information about the wine-cvs mailing list