From a80bc8afe1c6c395612b7625dff74beec7f29168 Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:43:32 +0200 Subject: [PATCH] Revert "Use guid to identify icon (#27570)" (#27669) This reverts commit 4bf031d28f5c66c188ca7de244921f3ee1cb14a2. --- src/runner/tray_icon.cpp | 8 +++----- src/runner/tray_icon.h | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/runner/tray_icon.cpp b/src/runner/tray_icon.cpp index 28795accf3..38d110a6ea 100644 --- a/src/runner/tray_icon.cpp +++ b/src/runner/tray_icon.cpp @@ -274,7 +274,7 @@ void start_tray_icon() auto icon = LoadIcon(h_instance, MAKEINTRESOURCE(APPICON)); if (icon) { - wm_icon_notify = RegisterWindowMessageW(L"WM_PowerToysIconNotify"); + UINT id_tray_icon = wm_icon_notify = RegisterWindowMessageW(L"WM_PowerToysIconNotify"); WNDCLASS wc = {}; wc.hCursor = LoadCursor(nullptr, IDC_ARROW); @@ -302,13 +302,11 @@ void start_tray_icon() tray_icon_data.cbSize = sizeof(tray_icon_data); tray_icon_data.hIcon = icon; tray_icon_data.hWnd = hwnd; - GUID guid; - CLSIDFromString(tray_icon_guid, &guid); - tray_icon_data.guidItem = guid; + tray_icon_data.uID = id_tray_icon; tray_icon_data.uCallbackMessage = wm_icon_notify; std::wstring about_msg_pt_version = L"PowerToys " + get_product_version(); wcscpy_s(tray_icon_data.szTip, sizeof(tray_icon_data.szTip) / sizeof(WCHAR), about_msg_pt_version.c_str()); - tray_icon_data.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE | NIF_GUID; + tray_icon_data.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE; ChangeWindowMessageFilterEx(hwnd, WM_COMMAND, MSGFLT_ALLOW, nullptr); tray_icon_created = Shell_NotifyIcon(NIM_ADD, &tray_icon_data) == TRUE; diff --git a/src/runner/tray_icon.h b/src/runner/tray_icon.h index b3cdad7a70..812f1f1c20 100644 --- a/src/runner/tray_icon.h +++ b/src/runner/tray_icon.h @@ -13,6 +13,4 @@ typedef void (*main_loop_callback_function)(PVOID); // Calls a callback in _callback bool dispatch_run_on_main_ui_thread(main_loop_callback_function _callback, PVOID data); -const inline wchar_t* pt_tray_icon_window_class = L"PToyTrayIconWindow"; - -const inline wchar_t* tray_icon_guid = L"{F933F1D8-B8AE-41A4-A134-FB36323E0095}"; +const inline wchar_t* pt_tray_icon_window_class = L"PToyTrayIconWindow"; \ No newline at end of file