Revert "Use guid to identify icon (#27570)" (#27669)

This reverts commit 4bf031d28f.
This commit is contained in:
Stefan Markovic 2023-07-28 13:43:32 +02:00 committed by GitHub
parent de96c897dc
commit a80bc8afe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -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;

View File

@ -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";