MCPcopy Create free account
hub / github.com/bumptop/BumpTop / SetFocusOnWindow

Method SetFocusOnWindow

trunk/win/Source/BT_WindowsOS.cpp:5012–5028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5010}
5011
5012void WindowsSystem::SetFocusOnWindow()
5013{
5014 HWND btWindow = winOS->GetWindowsHandle();
5015
5016 // workaround as SetFocus only works from the
5017 // active process
5018 DWORD fgTid = GetWindowThreadProcessId(GetForegroundWindow(), 0);
5019 DWORD btTid = GetWindowThreadProcessId(btWindow, 0);
5020 if (btTid != fgTid)
5021 AttachThreadInput(btTid, fgTid, TRUE);
5022
5023 SetFocus(btWindow);
5024
5025 // unattach
5026 if (btTid != fgTid)
5027 AttachThreadInput(btTid, fgTid, FALSE);
5028}
5029
5030void WindowsSystem::ResizeWindow()
5031{

Callers 3

onPrimaryMouseDownMethod · 0.80
InitNxFunction · 0.80
OnTimerMethod · 0.80

Calls 2

GetWindowsHandleMethod · 0.80
SetFocusFunction · 0.50

Tested by

no test coverage detected