PlatformWindowPtr WinPlatform::getCurrentWindow() { currentWindow = GetForegroundWindow(); if (!isAltTabWindow(currentWindow)) EnumWindows(getCurrentWindowProc, 0); return PlatformWindowPtr( currentWindow ? new WinPlatformWindow(currentWindow) : nullptr ); }
BOOL CALLBACK getCurrentWindowProc(HWND window, LPARAM) { if (!isAltTabWindow(window)) return TRUE; currentWindow = window; return FALSE; }