Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8d34e0

Browse files
authored
allow custom titles for the launcher
Custom option for launcher title
2 parents77df64b +760566a commite8d34e0

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

‎launcher/CmderLauncher.vcxproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<ProjectGuid>{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}</ProjectGuid>
2323
<Keyword>Win32Proj</Keyword>
2424
<RootNamespace>CmderLauncher</RootNamespace>
25+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2526
</PropertyGroup>
2627
<ImportProject="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2728
<PropertyGroupCondition="'$(Configuration)|$(Platform)'=='Debug|Win32'"Label="Configuration">

‎launcher/src/CmderLauncher.cpp‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ bool FileExists(const wchar_t * filePath)
105105
returnfalse;
106106
}
107107

108-
voidStartCmder(std::wstring path =L"",bool is_single_mode =false, std::wstring taskName =L"", std::wstring iconPath =L"", std::wstring cfgRoot =L"",bool use_user_cfg =true, std::wstring conemu_args =L"")
108+
voidStartCmder(std::wstring path =L"",bool is_single_mode =false, std::wstring taskName =L"", std::wstringtitle =L"", std::wstringiconPath =L"", std::wstring cfgRoot =L"",bool use_user_cfg =true, std::wstring conemu_args =L"")
109109
{
110110
#if USE_TASKBAR_API
111111
wchar_t appId[MAX_PATH] = {0 };
@@ -132,6 +132,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
132132

133133
std::wstring cmderStart = path;
134134
std::wstring cmderTask = taskName;
135+
std::wstring cmderTitle = title;
135136
std::wstring cmderConEmuArgs = conemu_args;
136137

137138
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
@@ -412,7 +413,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
412413
PathCombine(conEmuPath, exeDir,L"vendor\\conemu-maximus5\\ConEmu.exe");
413414
}
414415

415-
swprintf_s(args,L"%s /Icon\"%s\" /Title Cmder", args, icoPath);
416+
swprintf_s(args,L"%s /Icon\"%s\"", args, icoPath);
416417

417418
if (!streqi(cmderStart.c_str(),L""))
418419
{
@@ -429,6 +430,11 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
429430
swprintf_s(args,L"%s /run {%s}", args, cmderTask.c_str());
430431
}
431432

433+
if (!streqi(cmderTitle.c_str(),L""))
434+
{
435+
swprintf_s(args,L"%s /title\"%s\"", args, cmderTitle.c_str());
436+
}
437+
432438
if (cfgRoot.length() !=0)
433439
{
434440
swprintf_s(args,L"%s -loadcfgfile\"%s\"", args, userConEmuCfgPath);
@@ -574,6 +580,7 @@ struct cmderOptions
574580
std::wstring cmderCfgRoot =L"";
575581
std::wstring cmderStart =L"";
576582
std::wstring cmderTask =L"";
583+
std::wstring cmderTitle =L"Cmder";
577584
std::wstring cmderIcon =L"";
578585
std::wstring cmderRegScope =L"USER";
579586
std::wstring cmderConEmuArgs =L"";
@@ -636,6 +643,11 @@ cmderOptions GetOption()
636643
cmderOptions.cmderTask = szArgList[i +1];
637644
i++;
638645
}
646+
elseif (_wcsicmp(L"/title", szArgList[i]) ==0)
647+
{
648+
cmderOptions.cmderTitle = szArgList[i +1];
649+
i++;
650+
}
639651
elseif (_wcsicmp(L"/icon", szArgList[i]) ==0)
640652
{
641653
cmderOptions.cmderIcon = szArgList[i +1];
@@ -764,8 +776,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
764776
}
765777
else
766778
{
767-
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs);
779+
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs);
768780
}
769781

770782
return0;
771-
}
783+
}

‎launcher/src/strings.rc2‎

100755100644
File mode changed.

‎scripts/build.ps1‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ if ($ConEmuXml -ne "") {
117117
Pop-Location
118118

119119
if($Compile) {
120+
cmd.exe/C"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
120121
Push-Location-Path$launcher
121122
Create-RC$version ($launcher+'\src\version.rc2');
122123
# https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp