I'm writing a python script for an app lock. For this, I'm executing the Get-Process -Name "notepad++" PowerShell command using python subprocess to get the process id.

Now, using psutil I'm able to kill the process. But my objective is to minimize the windows in a while loop either using powershell/python. So, the program becomes unusable until the user enters the password.