im trying to take screenshoot with pyautogui of specific background window without put it in foreground, how can i make that ? this is my started project but i dont know what is the next step
in this example, chrome.exe run in background and i m trying to take screenshoot without put the window in forground
thanks
#pip install pywin32
import pyautogui
import win32gui, win32api, win32con
import time
def takescreen():
myScreenshot = pyautogui.screenshot()
myScreenshot.save(r'screenshoot.png')
hwnd = win32gui.FindWindow(None, 'Chrome')
hwndChild = win32gui.GetWindow(hwnd, win32con.GW_CHILD)
hwndChild2 = win32gui.GetWindow(hwndChild, win32con.GW_CHILD)
##NEXT STEP