Whenever I run my pong game (programmed in python using pygame) the window is not interactive until clicked and the title bar is greyed out as in the image linked below. When I start my program it takes text input from the user in the CLI and only then opens the window which is why the window used to be placed under all the other windows. I used the SetWindowPos function from the module win32gui to place it over all the other windows but it didn't set focus on the window which is the issue.
How do I make sure that this does not happen and that the window is immediately focused on? I've looked everywhere for solutions to this but couldn't find anything helpful. I am using Python 3.10.5 with Pygame 2.5.1 on Visual Studio Code and I am running this program on Windows 11