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

Method PreTranslateMessage

TranslucentTB/uwp/xamlthread.cpp:61–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61bool XamlThread::PreTranslateMessage(const MSG &msg)
62{
63 // prevent XAML islands from capturing ALT-{F4,SPACE} because of
64 // https://github.com/microsoft/microsoft-ui-xaml/issues/2408
65 if (msg.message == WM_SYSKEYDOWN && (msg.wParam == VK_F4 || msg.wParam == VK_SPACE)) [[unlikely]]
66 {
67 Window(msg.hwnd).ancestor(GA_ROOT).send_message(msg.message, msg.wParam, msg.lParam);
68 return true;
69 }
70
71 if (m_Source)
72 {
73 BOOL result;
74 const HRESULT hr = m_Source->PreTranslateMessage(&msg, &result);
75 if (SUCCEEDED(hr))
76 {
77 if (result)
78 {
79 return result;
80 }
81 }
82 else
83 {
84 HresultHandle(hr, spdlog::level::warn, L"Failed to pre-translate message");
85 }
86 }
87
88 return false;
89}
90
91winrt::fire_and_forget XamlThread::ThreadDeinit()
92{

Callers 2

RunMethod · 0.45
ThreadProcMethod · 0.45

Calls 3

send_messageMethod · 0.80
ancestorMethod · 0.80
WindowClass · 0.50

Tested by

no test coverage detected