How to Solve NameError: name 'GetWindowRect' is not defined -- win32gui

Solution: Import the 'GetWindowRect' module

To Solve the error, add the following line to the top of your code.

from win32gui import GetWindowRect

 

For more information:
Python win32gui GetWindowRect