|
Parent Display Device Contexts
A parent DC enables an application to minimize the time necessary to set up the clipping
region for a window. An application typically uses parent DCs to speed up
drawing for control windows without requiring a private or class DC. For example,
Windows uses parent DCs for push button and edit controls. Parent DCs are
intended for use with child windows only, never with top-level or pop-up windows.
An application can specify the CS_PARENTDC style to set the clipping region of
the child window to that of the parent window so that the child can draw in
the parent. Specifying CS_PARENTDC enhances an application's performance because
Windows doesn't need to keep recalculating the visible region for each child
window.
Attribute values set by the parent window are not preserved for the child
window; for example, the parent window cannot set the brush for its child windows.
The only property preserved is the clipping region. The window must clip its
own output to the limits of the window. Because the clipping region for the
parent DC is identical to the parent window, the child window can potentially draw
over the entire parent window, but the parent DC must not be used in this way.
Windows ignores the CS_PARENTDC style if the parent window uses a private or
class DC, if the parent window clips its child windows, or if the child window
clips its child windows or sibling windows.
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|