MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / get_active_hwnd

Method get_active_hwnd

source/MaaWin32ControlUnit/Input/MessageInput.cpp:119–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119HWND MessageInput::get_active_hwnd()
120{
121 HWND root = GetAncestor(hwnd_, GA_ROOTOWNER);
122 if (!root) {
123 LogWarn << "GetAncestor returned nullptr, hwnd_ may be invalid" << VAR(hwnd_);
124 return hwnd_;
125 }
126 HWND popup = GetLastActivePopup(root);
127 if (popup && popup != hwnd_ && IsWindowVisible(popup)) {
128 return popup;
129 }
130 return hwnd_;
131}
132
133LPARAM MessageInput::make_mouse_lparam(HWND target, int x, int y)
134{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected