https://devblogs.microsoft.com/oldnewthing/20130619-00/?p=4043
AttachThreadInput is like taking two threads and pooling their money into a joint bank account,...
Jun 19, 2013 - Consider this code: // Code in italics is wrong foregroundThreadId = ::GetWindowThreadProcessId(::GetForegroundWindow(), 0); myThreadId = GetCurrentThreadId();...