def FX_SetForegroundWindow(FXWindow): try: win32gui.SetForegroundWindow(FXWindow.GetWin32Window()) return True except: return False