New to Python: Why do I get the error ImportError: cannot import name 'SetWindowPos' from 'win32con'

I am trying to put together some code that will pin the pygame window to the front – after doing some research I think the simplest way to do this in python 3.9 is is with import win32gui from win32con import SetWindowPos SetWindowPos(pygame.display.get_wm_info()[‘window’], win32con.HWND_TOPMOST, 0,0,0,0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE) but I consistently get the error message… Read More New to Python: Why do I get the error ImportError: cannot import name 'SetWindowPos' from 'win32con'

GetSystemMetrics(SM_CYSCREEN); | Gives wrong value| but GetSystemMetrics(SM_CXSCREEN); gives correct value

I have a problem with GetSystemMetrics(SM_CYSCREEN); – the height this function returns is random each time I run the program but the width function, GetSystemMetrics(SM_CXSCREEN); gives the correct value. Here is my code: #include <windows.h> #include <tchar.h> #include <stdio.h> int MessageBoxPrintf(const wchar_t * szCaption, const wchar_t * szFormat, …) { wchar_t buffer[1024]; va_list v1; va_start(v1,… Read More GetSystemMetrics(SM_CYSCREEN); | Gives wrong value| but GetSystemMetrics(SM_CXSCREEN); gives correct value

Minimize Process from powershell/python using Process ID (PID)

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… Read More Minimize Process from powershell/python using Process ID (PID)