DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Capture hidden window from command line while keeping window hidden  (Read 6,727 times)

smileypete

  • Participant
  • Joined in 2010
  • *
  • Posts: 2
Hi,

By hidden window I mean one that's covered by other windows.

I've tried doing this with Minicap but it always brings to window to the front.

Does anyone know of other utilities out there that can do this?

many thanks,
Pete.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
there may be a way to add this feature to minicap; i have something else i have to add as well, so maybe i can try.  i'm not sure it will work but it should be easy to try and find out.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Is it possible at all to capture a window that's obscured, whether partially or entirely?

(Under Vista+ with Aero enabled it probably is, but I'm thinking across all versions).
- carpe noctem

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Quote
Is it possible at all to capture a window that's obscured, whether partially or entirely?
i believe it is -- there is a print-like api command to instruct a window to paint itself to an offscreen buffer.
screenshot captor uses it in some cases, but not all.

what is being asked for may be solvable by skipping any force-foreground call in the minicap code, and ensuring that the print api command is used.  it may not always work but providing an option to try it is worth a try.

smileypete

  • Participant
  • Joined in 2010
  • *
  • Posts: 2
what is being asked for may be solvable by skipping any force-foreground call in the minicap code, and ensuring that the print api command is used.  it may not always work but providing an option to try it is worth a try.
Thanks. As I understand it in normal use the OS asks the window to repaint itself into desktop memory space when the window is moved, brought to the top, etc. So there's a good chance it's possible if the window can be asked to paint itself into a provided buffer.

I found a lot of material on capturing hidden windows in a Google search, but nothing on a simple utility that would do it.

In Minicap there's a -setfore 'Set window to be captured to foreground before capturing' switch, but it seems to be implicit as the window is always brought to the foreground without using it.

So if MiniCap can be made to capture hidden windows, maybe a -nofore switch would be one way to go. If the switch is used the program would attempt capture without bringing the window to the foreground and keeping it hidden.

cheers,
Pete.

Original address: https://www.donationcoder.com/forum/index.php?topic=23713.0