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

Method MessageHandler

TranslucentTB/mainappwindow.cpp:11–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "../ProgramLog/error/win32.hpp"
10
11LRESULT MainAppWindow::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam)
12{
13 switch (uMsg)
14 {
15 case WM_CLOSE:
16 Exit();
17 return 1;
18
19 case WM_QUERYENDSESSION:
20 if (lParam & ENDSESSION_CLOSEAPP)
21 {
22 // The app is being queried if it can close for an update.
23 RegisterApplicationRestart(nullptr, 0);
24 }
25 return 1;
26
27 case WM_ENDSESSION:
28 if (wParam)
29 {
30 // The app can be killed after processing this message, but we'll try doing it gracefully
31 Exit();
32 }
33
34 return 0;
35
36 default:
37 if (uMsg == m_NewInstanceMessage)
38 {
39 if (!m_App.BringWelcomeToFront())
40 {
41 SendNotification(IDS_ALREADY_RUNNING, NIF_REALTIME, NIIF_INFO);
42 m_App.GetWorker().ResetState(true);
43 }
44
45 return 0;
46 }
47 else
48 {
49 return TrayContextMenu::MessageHandler(uMsg, wParam, lParam);
50 }
51 }
52}
53
54void MainAppWindow::RefreshMenu()
55{

Callers

nothing calls this directly

Calls 2

BringWelcomeToFrontMethod · 0.80
ResetStateMethod · 0.80

Tested by

no test coverage detected