diff --git a/src/modules/colorPicker/ColorPicker/dllmain.cpp b/src/modules/colorPicker/ColorPicker/dllmain.cpp index f8c0c0cc25..7f92611704 100644 --- a/src/modules/colorPicker/ColorPicker/dllmain.cpp +++ b/src/modules/colorPicker/ColorPicker/dllmain.cpp @@ -132,7 +132,7 @@ public: { if (m_enabled) { - terminateProcess(); + TerminateProcess(m_hProcess, 1); } m_enabled = false; @@ -142,28 +142,6 @@ public: { return m_enabled; } - - static BOOL CALLBACK requestMainWindowClose(HWND nextWindow, LPARAM closePid) - { - DWORD windowPid; - GetWindowThreadProcessId(nextWindow, &windowPid); - - if (windowPid == (DWORD)closePid) - ::PostMessage(nextWindow, WM_CLOSE, 0, 0); - - return true; - } - - void terminateProcess() - { - DWORD processID = GetProcessId(m_hProcess); - EnumWindows(&requestMainWindowClose, processID); - const DWORD result = WaitForSingleObject(m_hProcess, MAX_WAIT_MILLISEC); - if (result == WAIT_TIMEOUT) - { - TerminateProcess(m_hProcess, 1); - } - } }; extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()