MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / MessageHandler

Method MessageHandler

TranslucentTB/tray/trayicon.cpp:61–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61LRESULT TrayIcon::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam)
62{
63 switch (uMsg)
64 {
65 case WM_DPICHANGED:
66 case WM_SETTINGCHANGE:
67 case WM_THEMECHANGED:
68 case WM_DISPLAYCHANGE:
69 LoadThemedIcon();
70
71 if (m_CurrentlyShowing)
72 {
73 Notify(NIM_MODIFY);
74 }
75 break;
76 default:
77 if (uMsg == m_TaskbarCreatedMessage)
78 {
79 LoadThemedIcon();
80
81 // https://github.com/TranslucentTB/TranslucentTB/issues/417
82 // we also get this message when DPI changes. Check if explorer truly
83 // restarted by seeing if a normal NIM_MODIFY worked
84 m_CurrentlyShowing = Shell_NotifyIcon(NIM_MODIFY, &m_IconData);
85
86 if (m_ShowPreference)
87 {
88 Show();
89 }
90
91 return 0;
92 }
93 }
94
95 return MessageWindow::MessageHandler(uMsg, wParam, lParam);
96}
97
98std::optional<RECT> TrayIcon::GetTrayRect()
99{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected