PrintWindow Example - Delphi Source Code

posted 2 Mar 2010, 12:00 by Danny Rancher   [ updated 8 Jun 2010, 19:12 by Delphi Basics ]
{
    Coder: counterstrikewi
    Website: www.delphi.co.nr
    Compiled: Delphi 2007
}

This example shows you how to use the PrintWindow API to view the visual output of a window which may, or may not be visible on the screen.
It can therefore be used as an alternative to BitBlt for a more complete screenshot project.

MSDN - PrintWindow
http://msdn.microsoft.com/en-us/library/dd162869%28VS.85%29.aspx

The PrintWindow function copies a visual window into the specified device context (DC), typically a printer DC.

BOOL PrintWindow(
HWND hwnd,
HDC hdcBlt,
UINT nFlags
);

Parameters

hwnd - A handle to the window that will be copied.
hdcBlt -
A handle to the device context.
nFlags -
The drawing options. It can be one of the following values:
                  nil - Entire Window is copied to hdcBlt
                PW_CLIENTONLY - Only the client area of the window is copied to hdcBlt.


Only Delphi source code is included in the archive.

ċ
[SRC]PrintWindowExample.rar
(5k)
Delphi Basics,
2 Mar 2010, 12:08
Comments