SyntaxFix
Write A Post
Hire A Developer
Questions
Use the Windows API. Call GetForegroundWindow().
GetForegroundWindow()
GetForegroundWindow() will give you a handle (named hWnd) to the active window.
hWnd
Documentation: GetForegroundWindow function | Microsoft Docs