Release v0.6.39: isolate history UI and image clipboard memory

This commit is contained in:
2026-11-04 19:40:54 +02:00
parent fa2f6d2ce4
commit 00c9cb0ee4
22 changed files with 747 additions and 49 deletions
+16
View File
@@ -1,12 +1,27 @@
#include "app.h"
#include <shellapi.h>
#include <shlobj.h>
#include "configuration.h"
int WINAPI wWinMain(HINSTANCE instance, HINSTANCE, PWSTR, int)
{
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
int argc{};
auto argv = CommandLineToArgvW(GetCommandLineW(), &argc);
std::wstring arg = argc > 1 ? argv[1] : L"";
if (argc == 2 && arg.starts_with(L"--history-host=")) {
LocalFree(argv);
int result = 1;
try {
auto service = reinterpret_cast<HWND>(uintptr_t(std::stoull(arg.substr(15))));
wchar_t name[64]{}; GetClassNameW(service, name, 64);
if (std::wstring(name) != L"KSwitcher.Main" || !ks::configurationPeer(service, L"KSwitcher.exe"))
throw std::runtime_error("Invalid history service");
ks::App app(instance, true, {}, service);
result = app.execute();
} catch (...) {}
CoUninitialize();
return result;
}
if (arg.starts_with(L"--configure-autostart="))
{
int result = 1;
@@ -72,6 +87,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE, PWSTR, int)
try
{
ks::App app(instance, arg == L"--smoke-test");
app.isolateHistory = !app.smoke;
if (arg.starts_with(L"--update-ready-event="))
app.updateStartupEvent = arg.substr(std::wstring(L"--update-ready-event=").size());
else if (!arg.empty() && arg != L"--smoke-test")