Код (C): GetActiveWindow() https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getactivewindow