Linked Questions

Popular Questions

Restore window without setting to foreground

Asked by At

I can only take an image of a non-iconic (not minimized) window, so if I see one I restore it, but then it pops to the foreground. Right now I have this solution:

if win32gui.IsIconic(hwnd):
    active_hwnd= win32gui.GetForegroundWindow()
    win32gui.ShowWindow(hwnd, win32con.SW_RESTORE)
    win32gui.SetForegroundWindow(active_hwnd)

but sometimes the flickering is interrupting other running processes. How can I restore a window, and set it to be the last in the windows z-order?

Related Questions