Fix for SetForegroundWindow in some situations.