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

Method MessageHandler

TranslucentTB/uwp/basexamlpagehost.cpp:122–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122LRESULT BaseXamlPageHost::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam)
123{
124 switch (uMsg)
125 {
126 case WM_QUERYENDSESSION:
127 if (!TryClose())
128 {
129 return 0;
130 }
131 else
132 {
133 return 1;
134 }
135
136 case WM_SETTINGCHANGE:
137 case WM_THEMECHANGED:
138 case WM_SIZE:
139 if (const auto coreWin = UWP::GetCoreWindow())
140 {
141 // forward theme changes to the fake core window
142 // so that they propagate to our islands
143 // do the same for size: https://github.com/microsoft/microsoft-ui-xaml/issues/3577#issuecomment-1399250405
144 coreWin.send_message(uMsg, wParam, lParam);
145 }
146
147 break;
148
149 case WM_NCCALCSIZE:
150 return 0;
151
152 case WM_DWMCOMPOSITIONCHANGED:
153 UpdateFrame();
154 return 0;
155
156 case WM_SETFOCUS:
157 if (!SetFocus(m_interopWnd))
158 {
159 LastErrorHandle(spdlog::level::info, L"Failed to set focus to Island host");
160 }
161 return 0;
162
163 case WM_DPICHANGED:
164 {
165 const auto newRect = reinterpret_cast<RECT *>(lParam);
166
167 ResizeWindow(newRect->left, newRect->top, newRect->right - newRect->left, newRect->bottom - newRect->top, true);
168 return 0;
169 }
170 }
171
172 return MessageWindow::MessageHandler(uMsg, wParam, lParam);
173}
174
175void BaseXamlPageHost::ResizeWindow(int x, int y, int width, int height, bool move, UINT flags)
176{

Callers

nothing calls this directly

Calls 1

send_messageMethod · 0.80

Tested by

no test coverage detected