I am using win32gui
to move a Notepad window to the origin of the screen (0, 0) with width and height equal to 500. The result is that the window is not moved to the true left border but ~10 px. to the right. Also the width and height do not equal 500 px. (~620 px. instead).
I am using the following code to produce my results.
import win32gui
from PIL import ImageGrab
# Open notepad.exe manually.
hwnd = win32gui.FindWindow(None, "Untitled - Notepad")
win32gui.MoveWindow(hwnd, 0, 0, 500, 500, True)
bbox = win32gui.GetWindowRect(hwnd)
img = ImageGrab.grab(bbox)
Here a screenshot of the overall position of the window on the screen: