mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
Add in verbose error message and telemetry for SetWindowsHookEx failure (#6454)
* Updated error message when SetWindowsHookEx fails to show correct error message * Added telemetry for exception in SG, FZ and KBM * Rename exception to error
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <msclr\marshal.h>
|
||||
#include <msclr\marshal_cppstd.h>
|
||||
#include <common/debug_control.h>
|
||||
#include <common/common.h>
|
||||
|
||||
using namespace interop;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
@@ -46,7 +47,8 @@ void KeyboardHook::Start()
|
||||
0);
|
||||
if (hookHandle == nullptr)
|
||||
{
|
||||
throw std::exception("SetWindowsHookEx failed.");
|
||||
DWORD errorCode = GetLastError();
|
||||
show_last_error_message(L"SetWindowsHookEx", errorCode, L"PowerToys - Interop");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user