mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +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:
@@ -6,6 +6,13 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace localized_strings
|
||||
{
|
||||
const wchar_t LAST_ERROR_FORMAT_STRING[] = L"%s failed with error %d: %s";
|
||||
const wchar_t LAST_ERROR_TITLE_STRING[] = L"Error";
|
||||
}
|
||||
|
||||
// Gets position of given window.
|
||||
std::optional<RECT> get_window_pos(HWND hwnd);
|
||||
|
||||
@@ -16,7 +23,7 @@ bool is_system_window(HWND hwnd, const char* class_name);
|
||||
int run_message_loop(const bool until_idle = false, const std::optional<uint32_t> timeout_seconds = {});
|
||||
|
||||
std::optional<std::wstring> get_last_error_message(const DWORD dw);
|
||||
void show_last_error_message(LPCWSTR lpszFunction, DWORD dw);
|
||||
void show_last_error_message(LPCWSTR lpszFunction, DWORD dw, LPCWSTR errorTitle = localized_strings::LAST_ERROR_TITLE_STRING);
|
||||
|
||||
enum WindowState
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user