Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A black or horizontally shifted title bar usually means that BitBlt copied the right pixels from the wrong coordinate space or device context. First establish whether you want the composed screen, the complete top-level window, or only client content. Then compare the rectangle with GetWindowRect and GetClientRect, identify the source DC and its origin, and check DPI, custom-frame, and layered-window behavior. Use PrintWindow only when asking the target application to render is more appropriate than copying an existing surface.

What the symptom usually means

BitBlt is a pixel-copy operation between device contexts. It does not tell the target window to repaint. A capture can therefore contain a black title bar, a title bar from another location, or no title bar when the source rectangle and the source DC do not describe the same coordinate system.

  • Black or empty bar: the source surface may not contain the composed non-client pixels, or the application may render through a custom or layered path.
  • Shifted bar: screen coordinates were used with a client-local or redirected DC, or the window and client offsets were mixed.
  • Correct client area but wrong frame: the application may use a custom frame, DWM composition, or a different rendering path for the non-client area.

Windows Vista and later use the Desktop Window Manager (DWM) to control the appearance of conventional non-client areas, including the title bar. A custom-frame application can extend the client area into that frame or remove the standard frame, in which case its own code draws the title and handles related behavior.

Use this diagnostic sequence

  1. Define the intended image. Decide whether the result should match the visible, unobscured screen; include the complete top-level window; or contain only client-area content. These are different capture targets.
  2. Record the geometry. Log the values returned by GetWindowRect and GetClientRect, along with the rectangle passed to BitBlt. A top-level window rectangle is screen-relative. A client rectangle starts at local coordinate (0,0).
  3. Identify every DC. Note whether the source is a display DC, window DC, paint or redirected DC, or a compatible memory DC. A redirected window DC can use a back-buffer origin rather than the window’s screen location.
  4. Map coordinates explicitly. Do not pass screen coordinates directly to a DC whose origin is client-local or redirected. Convert the capture point to the source DC’s coordinate system and log the resulting source point.
  5. Inspect the frame implementation. Look for DwmExtendFrameIntoClientArea, WM_NCCALCSIZE, custom non-client painting, and frame changes made with SetWindowPos(..., SWP_FRAMECHANGED).
  6. Check DPI awareness. Verify process and window DPI-awareness settings and the scale factor of the monitor containing the window. A mismatch can produce apparently correct coordinates with incorrect dimensions or offsets.
  7. Check layering. Determine whether the window uses SetLayeredWindowAttributes or UpdateLayeredWindow. These APIs use different content paths, so an ordinary DC copy may not reproduce the final composed result.
  8. Compare with a controlled capture. Keep the window unobscured, use a known rectangle, record the monitor scale, and compare the bitmap with the visible window. This separates geometry errors from rendering-path errors.

Keep the coordinate systems separate

Space Origin and extent Typical mistake
Screen The desktop coordinate system. GetWindowRect returns a top-level window’s screen-relative bounding rectangle. Using these coordinates as though they were local to a window DC.
Window The complete top-level window, including any conventional non-client frame. Assuming the frame is always present in a client or redirected surface.
Client Application content; GetClientRect starts at (0,0). Adding the screen position twice, or omitting the frame offset when sampling the screen.
Redirected back buffer A compositor-managed surface whose origin may be unrelated to the window’s screen position. Trusting a DC origin as proof that it is screen-relative.

For a screen capture, obtain a display DC and use screen coordinates. For client capture, use a client-compatible source and local coordinates. For a complete visible window, make sure the chosen source actually contains the frame you intend to copy; a client-only DC cannot supply pixels that are not in it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

A minimal geometry log

RECT wr{}, cr{};
GetWindowRect(hwnd, &wr);
GetClientRect(hwnd, &cr);

POINT clientOrigin{0, 0};
ClientToScreen(hwnd, &clientOrigin);

// Log wr.left, wr.top, wr.right, wr.bottom,
// cr.right, cr.bottom, and clientOrigin.x/y.

The client-to-screen point gives you the actual screen location of client coordinate zero. Compare it with the window rectangle rather than assuming a fixed title-bar height; borders, themes, DPI, and custom frames change that relationship.

Choose and use the source DC deliberately

A display DC represents the desktop and is the natural source when the requirement is “what is visible on screen.” A window or redirected DC may represent a window surface, but its origin and contents depend on how Windows and the application render that window. A compatible memory DC is normally a destination for the bitmap, not evidence that the source has screen coordinates.

Microsoft’s DWM guidance warns that the origin reported for a redirected DC can describe a back buffer at (0,0), not the window’s location on the desktop. It also discourages reading from a display DC as a general performance strategy; use it when screen composition is specifically what you need, and avoid repeatedly copying large areas unnecessarily.

Always check return values and dimensions. A failed GetDC, a zero-sized bitmap, or a negative/incorrect source point can look like a rendering defect. Release window and display DCs, delete compatible objects, and select the original bitmap back into a memory DC before deleting it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Standard and custom title bars are different capture targets

Conventional non-client frame

With a standard frame, DWM controls the appearance of the title bar, icon, border, and caption buttons. Copying client content does not automatically include those pixels. If you need the screen’s composed frame, capture the corresponding screen rectangle while the window is unobscured. If you need application-rendered content rather than the desktop composition, evaluate a render-request API instead.

Custom frame

Applications that call DwmExtendFrameIntoClientArea or handle WM_NCCALCSIZE can make the title area client content. The title text may then be drawn by application code, with custom hit testing and resizing. Treat the apparent title bar as client coordinates, not as a guaranteed non-client strip. When frame margins or non-client calculations change, a frame recalculation using SetWindowPos and SWP_FRAMECHANGED may be required by the application.

DPI awareness can create a shifted or cropped result

Windows can scale coordinates for processes that are not DPI-aware. Moving a window between monitors with different scale settings can expose a mismatch between logical units, physical pixels, and the dimensions of the bitmap allocated for the copy. Declare and configure DPI awareness deliberately, then inspect the process’s awareness mode, monitor scale, window size, and capture bitmap size in the same run. DPI is a candidate explanation for mismatched dimensions or offsets, not a universal diagnosis.

Do not “fix” the issue by adding a hard-coded title-bar height or multiplying every coordinate by a guessed scale. Those work only for one frame style and monitor configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Layered windows need a rendering-path check

SetLayeredWindowAttributes redirects legacy painting into off-screen memory for recomposition. UpdateLayeredWindow lets an application supply the layered window’s shape and content directly. Confirm which path is used before selecting a capture method. A normal window DC copy may omit alpha-composited or directly supplied content even when the window looks correct on screen.

When to try PrintWindow

PrintWindow asks the application that owns the window to render into a supplied DC. Windows sends the appropriate WM_PRINT or WM_PRINTCLIENT request, and the target application’s implementation determines what is returned. This makes it fundamentally different from BitBlt, which copies pixels already present in a source DC.

HDC target = CreateCompatibleDC(screenDc);
HBITMAP bitmap = CreateCompatibleBitmap(screenDc, width, height);
HGDIOBJ old = SelectObject(target, bitmap);

BOOL ok = PrintWindow(hwnd, target, 0); // use PW_CLIENTONLY for client content

SelectObject(target, old);
DeleteObject(bitmap);
DeleteDC(target);

The call is synchronous. Keep it off a latency-sensitive UI thread, impose your own cancellation or timeout policy around the operation, and treat an incomplete result as a target-application limitation rather than proof that your rectangle is correct. Some applications do not implement the requested drawing path for every visual element.

Common failures and fixes

Symptom Likely cause Action
Client area is correct; title bar is black The source contains client pixels but not the DWM-composed non-client frame. Capture the visible screen rectangle, or test PrintWindow if target-side rendering is acceptable.
Everything is shifted by the window’s screen position Screen coordinates were passed to a client-local or redirected DC. Convert the point with ScreenToClient or map it to the documented source origin.
Only one monitor or scale setting fails DPI virtualization or mixed logical/physical units. Verify DPI awareness and log monitor scale, rectangle, and bitmap dimensions together.
Custom title text is missing The title is client-drawn and the selected source does not include that client region. Inspect WM_NCCALCSIZE, frame extension, and the application’s paint path.
Layered window appears transparent or incomplete The capture method does not reproduce the layered content path. Identify SetLayeredWindowAttributes versus UpdateLayeredWindow and choose a composed-screen or target-render capture accordingly.
PrintWindow hangs or returns partial content It is synchronous and the target controls its response. Move the call away from the UI thread and handle unsupported or slow target rendering.

Performance and reliability considerations

  • Copy only the rectangle required; full-desktop BitBlt operations are expensive when repeated.
  • Reuse compatible DCs and bitmap allocations when dimensions remain stable, while recreating them safely when the window or DPI changes.
  • Do not infer correctness from a successful API return value alone. Validate dimensions, pixels, and the intended composition target.
  • Expect occlusion, minimized windows, hardware-accelerated surfaces, custom rendering, and layered content to behave differently from ordinary GDI client painting.
  • Record the window styles, DPI mode, monitor, DC type, rectangle values, and capture method in diagnostic logs so a failure can be reproduced.

Or skip the browser setup

If your actual goal is a reliable website image rather than debugging a native window, ScreenshotNeo provides a single HTTP capture endpoint. It removes cookie and consent banners, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page verdict and billing status in headers.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the same request from any environment; the ScreenshotNeo documentation lists all options.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

It also offers an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

FAQ

Can I guarantee a title bar height by using a constant?

No. Theme, borders, DPI, and custom-frame behavior make a fixed height unreliable. Measure the actual rectangles or capture the composed screen.

Does PrintWindow always capture what the user sees?

No. It requests target-side rendering, and the owning application decides which content it draws in response.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does an unobscured screen capture differ from a window-DC capture?

They represent different surfaces: one is compositor output on the desktop, while the other may be client, redirected, layered, or application-owned content.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Should I use a website screenshot API to repair a Win32 BitBlt bug?

No. ScreenshotNeo is for website capture. A black or shifted native title bar still requires correcting the Win32 rectangle, DC, frame, DPI, or rendering-path choice.

Frequently Asked Questions

What should I log first when diagnosing a shifted BitBlt capture?

Log the source DC type, the BitBlt source point and size, GetWindowRect, GetClientRect, the client origin in screen coordinates, DPI-awareness mode, and monitor scale.

Is a black title bar proof that DWM is broken?

No. It more often indicates that the selected source surface does not contain the composed non-client pixels or that the application uses a custom or layered rendering path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What is the safest way to capture only client content?

Use client-local coordinates and a source that represents the client surface, or request client rendering explicitly with the appropriate PrintWindow option.

The Bottom Line

Fix the coordinate and rendering mismatch before changing raster operations: define the capture target, verify rectangle and DC origins, account for custom frames, DPI, and layering, then evaluate PrintWindow when target-side rendering is needed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.