mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
Added the code to launch another process
This commit is contained in:
@@ -206,14 +206,29 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable the powertoy
|
// Enable the powertoy
|
||||||
virtual void enable() {
|
virtual void enable()
|
||||||
m_enabled = true;
|
{
|
||||||
|
SHELLEXECUTEINFO sei{ sizeof(sei) };
|
||||||
|
sei.fMask = { SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI };
|
||||||
|
sei.lpFile = L"modules\\launcher\\Wox.exe";
|
||||||
|
sei.nShow = SW_SHOWNORMAL;
|
||||||
|
ShellExecuteEx(&sei);
|
||||||
|
|
||||||
|
m_hProcess = sei.hProcess;
|
||||||
|
|
||||||
|
m_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable the powertoy
|
// Disable the powertoy
|
||||||
virtual void disable() {
|
virtual void disable()
|
||||||
m_enabled = false;
|
{
|
||||||
|
if (m_enabled)
|
||||||
|
{
|
||||||
|
TerminateProcess(m_hProcess, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns if the powertoys is enabled
|
// Returns if the powertoys is enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user