Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 577345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:08:37+00:00 2026-05-13T14:08:37+00:00

I am trying to capture screen of a child window and render it on

  • 0

I am trying to capture screen of a child window and render it on parent surface in Windows 7.

HTHUMBNAIL thumbnail = NULL;
HRESULT hr = S_OK;
hr = DwmRegisterThumbnail( hWnd, visualHwnd, &thumbnail );

if( SUCCEEDED( hr ) )
{
    ...
}

This fails all the time. visualHwnd is the child window and hWnd is the parent. I also tried it without the parent-child relationship and it just doesn’t draw anything, well expected because if statement fails.

What could be the reason?

Here is how I create the parent:

hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

And the child:

CreateProcessA( NULL, "PVFOX.exe \"view3.pv\" ", NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &piVisual);
WaitForInputIdle( piVisual.hProcess, INFINITE );
Sleep( 3000 );

EnumWindows(EnumWindowsProc, 0);
SetParent(visualHwnd, hWnd);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:08:37+00:00Added an answer on May 13, 2026 at 2:08 pm

    From MSDN:

    • hwndDestination

      The handle to the window that will use the DWM thumbnail. Setting the destination window handles to anything other than a top level window type will result in an E_INVALIDARG.

    • hwndSource

      The handle to the window to as the thumbnail source. Setting the source window handles to anything other than a top level window type will result in an E_INVALIDARG.

    This is expected to fail if you pass a child window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to capture the screen whilst my windows mobile application is running.
I'm trying to capture the screen whenever something goes wrong, either an error or
I'm trying to capture the screen and then paint the image to a JFrame
I'm trying to capture the Tab key in a Windows Forms application and do
I am trying to capture an image of the screen for use in screencasting.
I am currently trying to design a piece of screen-capture software. One design question
Is there some method to issue a screen capture(browser window content only) from the
I'm trying to write a little app to capture keystrokes for a window under
I am trying capture UIIMage with UIGraphicsBeginImageContext(); but my code capture the whole screen
I'm trying to write a simple app that will do a screen capture of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.