mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[Launcher] Kill the Launcher immediately (#6747)
* Kill the Launcher immediately * Also rename the shared file
This commit is contained in:
@@ -11,7 +11,7 @@ extern "C" IMAGE_DOS_HEADER __ImageBase;
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const wchar_t POWER_LAUNCHER_PID_SHARED_FILE[] = L"Local\\3cbfbad4-199b-4e2c-9825-942d5d3d3c74";
|
const wchar_t POWER_LAUNCHER_PID_SHARED_FILE[] = L"Local\\PowerLauncherPidSharedFile-3cbfbad4-199b-4e2c-9825-942d5d3d3c74";
|
||||||
const wchar_t JSON_KEY_PROPERTIES[] = L"properties";
|
const wchar_t JSON_KEY_PROPERTIES[] = L"properties";
|
||||||
const wchar_t JSON_KEY_WIN[] = L"win";
|
const wchar_t JSON_KEY_WIN[] = L"win";
|
||||||
const wchar_t JSON_KEY_ALT[] = L"alt";
|
const wchar_t JSON_KEY_ALT[] = L"alt";
|
||||||
@@ -294,12 +294,16 @@ public:
|
|||||||
void terminateProcess()
|
void terminateProcess()
|
||||||
{
|
{
|
||||||
DWORD processID = GetProcessId(m_hProcess);
|
DWORD processID = GetProcessId(m_hProcess);
|
||||||
|
TerminateProcess(m_hProcess, 1);
|
||||||
|
// Temporarily disable sending a message to close
|
||||||
|
/*
|
||||||
EnumWindows(&requestMainWindowClose, processID);
|
EnumWindows(&requestMainWindowClose, processID);
|
||||||
const DWORD result = WaitForSingleObject(m_hProcess, MAX_WAIT_MILLISEC);
|
const DWORD result = WaitForSingleObject(m_hProcess, MAX_WAIT_MILLISEC);
|
||||||
if (result == WAIT_TIMEOUT || result == WAIT_FAILED)
|
if (result == WAIT_TIMEOUT || result == WAIT_FAILED)
|
||||||
{
|
{
|
||||||
TerminateProcess(m_hProcess, 1);
|
TerminateProcess(m_hProcess, 1);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -311,7 +315,7 @@ void Microsoft_Launcher::init_settings()
|
|||||||
// Load and parse the settings file for this PowerToy.
|
// Load and parse the settings file for this PowerToy.
|
||||||
PowerToysSettings::PowerToyValues settings =
|
PowerToysSettings::PowerToyValues settings =
|
||||||
PowerToysSettings::PowerToyValues::load_from_settings_file(get_name());
|
PowerToysSettings::PowerToyValues::load_from_settings_file(get_name());
|
||||||
|
|
||||||
parse_hotkey(settings);
|
parse_hotkey(settings);
|
||||||
}
|
}
|
||||||
catch (std::exception ex)
|
catch (std::exception ex)
|
||||||
@@ -335,7 +339,7 @@ void Microsoft_Launcher::parse_hotkey(PowerToysSettings::PowerToyValues& setting
|
|||||||
{
|
{
|
||||||
m_hotkey.key = 0;
|
m_hotkey.key = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
|
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user