OK, now I'm back to square one. Q_PID points to PROCESS_INFORMATION which doesn't contain the HWND I'm looking for. I was hoping there was a better way then using
GetForegroundWindow(). Or am I missing something fundamental here. I've only just started to digging into WinAPI.