I asked an earlier question about how I could detect whether a window was minimized or not and got this code for the answer:
window = win32gui.FindWindow("Notepad", None)
if window:
tup = win32gui.GetWindowPlacement(window)
if tup[1] == win32con.SW_SHOWMAXIMIZED:
minimized = False
elif tup[1] == win32con.SW_SHOWMINIMIZED:
minimized = True
elif tup[1] == win32con.SW_SHOWNORMAL:
normal = True
As I am sure it works, the problem is that I cannot figure out how to get "win32con" to work. I have tried pip installs, imports, and everything that goes along with it and I still get the error:
NameError: name 'win32con' is not defined
How can I resolve this error and properly import win32con? Thanks.