问题
Is it possible to set focus on a console app in Windows? SetFocus looks promising, but it needs an HWND and I don't know if console apps even have one.
回答1:
Use the GetConsoleWindow function.
来源:https://stackoverflow.com/questions/3223688/set-focus-on-console-in-windows