Using the example from the WIL documentation and also the tech database, Snapshot only works with (0)
if I use 1,2, or 3 it produces a 1KB file with no image?
Hmmm, what could be going wrong?
thanks you.
OK, tried on a different system with a single monitor and request (3) did work this time!
hmmm...
OK, not exactly, subsequent tries capture the entire screen again.
So when I run Snapshot(2) from a shortcut or taskbar.exe it shows Program Manager as the current window.
hmm,
I'm trying to capture the current app window on screen before running the Snapshot but even if I do a winactivate before it writes a 1KB output file which cannot be read.
Works as expected on my Windows 11 dual screen workstation. Keep in mind that executing a script from the taskbar can change the current active window.