Win32gui _verified_

win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)

Find a Notepad window, write the current date/time, save the file. win32gui

hwnd = win32gui.FindWindow(None, "Untitled - Notepad") if hwnd: win32gui.ShowWindow(hwnd, win32con.SW_RESTORE) # Restore if minimized win32gui.SetForegroundWindow(hwnd) # Bring to front 0) Find a Notepad window

import win32gui import win32con

After installation, you may need to run: write the current date/time