How to use ShowWIndow() and SetForegroundWindow Correctly?

4.3k views Asked by At

Here is what I want to do:

1)Open an application with username
2)Give some inputs
3)Open 2nd window for the application with different username
4)Give some inputs again
5)Switch to first application window, do somethg
6)Switch to second application

I am programming in python using the win32gui library. I have tried using the ShowWindow and SetForegroundWindow , but it doesnt work correctly, can someone please explain me what would be the way to do it in a very simple way?

1

There are 1 answers

0
i486 On

Call BringWindowToTop and SetActiveWindow functions.