From 31df5c3e5e50a3d8fda66508dbb524aa2e0e27f9 Mon Sep 17 00:00:00 2001 From: Gaizka P <1368043+kvittokonito@users.noreply.github.com> Date: Wed, 24 Jun 2020 07:17:48 +0200 Subject: [PATCH 1/7] Added support for setting custom titles for Cmder window. --- launcher/src/CmderLauncher.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 86ba8f3..f1f2734 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -71,7 +71,7 @@ bool FileExists(const wchar_t * filePath) return false; } -void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"") +void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring title = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"") { #if USE_TASKBAR_API wchar_t appId[MAX_PATH] = { 0 }; @@ -98,6 +98,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr std::wstring cmderStart = path; std::wstring cmderTask = taskName; + std::wstring cmderTitle = title; std::wstring cmderConEmuArgs = conemu_args; std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath); @@ -370,7 +371,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe"); } - swprintf_s(args, L"%s /Icon \"%s\" /Title Cmder", args, icoPath); + swprintf_s(args, L"%s /Icon \"%s\"", args, icoPath); if (!streqi(cmderStart.c_str(), L"")) { @@ -387,6 +388,11 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr swprintf_s(args, L"%s /run {%s}", args, cmderTask.c_str()); } + if (!streqi(cmderTitle.c_str(), L"")) + { + swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str()); + } + if (cfgRoot.length() != 0) { swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath); @@ -532,6 +538,7 @@ struct cmderOptions std::wstring cmderCfgRoot = L""; std::wstring cmderStart = L""; std::wstring cmderTask = L""; + std::wstring cmderTitle = L"Cmder"; std::wstring cmderRegScope = L"USER"; std::wstring cmderConEmuArgs = L""; bool cmderSingle = false; @@ -593,6 +600,11 @@ cmderOptions GetOption() cmderOptions.cmderTask = szArgList[i + 1]; i++; } + else if (_wcsicmp(L"/title", szArgList[i]) == 0) + { + cmderOptions.cmderTitle = szArgList[i + 1]; + i++; + } else if (_wcsicmp(L"/single", szArgList[i]) == 0) { cmderOptions.cmderSingle = true; @@ -659,13 +671,13 @@ cmderOptions GetOption() } else { - MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); + MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n /title [ConEmu Title]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); cmderOptions.error = true; } } else { - MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); + MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n /title [ConEmu Title]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); cmderOptions.error = true; } } @@ -707,7 +719,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } else { - StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs); + StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs); } return 0; From c89ef963474db041853a123b535317d3a7837432 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Mon, 18 Jul 2022 17:36:49 +0100 Subject: [PATCH 2/7] Remove XP platform Fixes #2723 --- launcher/CmderLauncher.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/CmderLauncher.vcxproj b/launcher/CmderLauncher.vcxproj index 6076523..75e19a4 100644 --- a/launcher/CmderLauncher.vcxproj +++ b/launcher/CmderLauncher.vcxproj @@ -28,7 +28,7 @@ Application true - v141_xp + v141 Unicode @@ -41,7 +41,7 @@ Application true - v141_xp + v141 Unicode From d1e033c312aaa920963f95fc56cbbbb070f4719b Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Mon, 18 Jul 2022 17:40:54 +0100 Subject: [PATCH 3/7] try 142 --- launcher/CmderLauncher.vcxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/launcher/CmderLauncher.vcxproj b/launcher/CmderLauncher.vcxproj index 75e19a4..c5208eb 100644 --- a/launcher/CmderLauncher.vcxproj +++ b/launcher/CmderLauncher.vcxproj @@ -28,7 +28,7 @@ Application true - v141 + v142 Unicode @@ -36,12 +36,12 @@ false true Unicode - v141 + v142 Application true - v141 + v142 Unicode @@ -49,7 +49,7 @@ false true Unicode - v141 + v142 From 52389f21f0767d3d32a4e73adfc60c70e8908be4 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Mon, 18 Jul 2022 17:42:09 +0100 Subject: [PATCH 4/7] VS 2019 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 83a7799..d6c6a9e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ branches: #---------------------------------# # Operating system (build VM template) -os: Visual Studio 2017 +os: Visual Studio 2019 #---------------------------------# # build configuration # From e48dec15ac98bdcd49885b8f1face843e7a0c726 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Mon, 18 Jul 2022 18:13:38 +0100 Subject: [PATCH 5/7] VS2022 --- appveyor.yml | 2 +- launcher/CmderLauncher.vcxproj | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d6c6a9e..968a381 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ branches: #---------------------------------# # Operating system (build VM template) -os: Visual Studio 2019 +os: Visual Studio 2022 #---------------------------------# # build configuration # diff --git a/launcher/CmderLauncher.vcxproj b/launcher/CmderLauncher.vcxproj index c5208eb..1ba3aa7 100644 --- a/launcher/CmderLauncher.vcxproj +++ b/launcher/CmderLauncher.vcxproj @@ -22,13 +22,13 @@ {4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3} Win32Proj CmderLauncher - 10.0.16299.0 + 10.0 Application true - v142 + v143 Unicode @@ -36,12 +36,12 @@ false true Unicode - v142 + v143 Application true - v142 + v143 Unicode @@ -49,7 +49,7 @@ false true Unicode - v142 + v143 @@ -189,4 +189,4 @@ - + \ No newline at end of file From 74060922a430dd88dbbb942d47194e20ba901df3 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Mon, 18 Jul 2022 18:21:08 +0100 Subject: [PATCH 6/7] run script before compile --- scripts/build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 7a78a85..a354f45 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -118,6 +118,7 @@ if ($ConEmuXml -ne "") { Pop-Location if($Compile) { + cmd.exe /C "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" Push-Location -Path $launcher Create-RC $version ($launcher + '\src\version.rc2'); msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release From 760566acb9407c03ce65e70a78db4ba581f9f92b Mon Sep 17 00:00:00 2001 From: David Refoua Date: Mon, 12 Sep 2022 22:33:52 +0430 Subject: [PATCH 7/7] resolve conflicts --- launcher/src/strings.rc2 | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 launcher/src/strings.rc2 diff --git a/launcher/src/strings.rc2 b/launcher/src/strings.rc2 old mode 100755 new mode 100644