Microsoft KB Archive/111005

From BetaArchive Wiki



DOCERR: CS_PARENTDC Class Style Description Incorrect

Last reviewed: December 2, 1996
Article ID: Q111005



The information in this article applies to: Microsoft Windows Software Development Kit (SDK) versions 3.1 Microsoft Win32 Application Programming Interface (API) included with:

    - Microsoft Windows NT versions 3.5 and 3.51
    - Microsoft Windows 95 version 4.0

SUMMARY

The documentation relating to the CS_PARENTDC window class style in the Windows SDK versions 3.0 and 3.1 states that CS_PARENTDC "Gives the display context of the parent window to the window class." The documentation for the Win32 SDK contains a similar statement. These statements are incorrect.

MORE INFORMATION

A window with the CS_PARENTDC style bit will receive a regular device context (DC) from the system's cache of device contexts. CS_PARENTDC merely sets the clipping rectangle of the child to that of the parent so that the child can draw on the parent. It does not give the child the parent's DC or DC settings.

CS_PARENTDC is used with all of Windows's standard controls such as edit controls and list boxes because it can help improve performance when drawing, especially in a dialog box. For example, dialog box units are not exact and if a child is drawing in a very small space it might accidentally draw outside its own border. This style provides a little room for error and prevents the child from being clipped unexpectedly.



KBCategory: kbui kbdocerr

KBSubcategory: UsrCls
Additional reference words: 3.00 3.10 3.50 4.00 95 WNDCLASS RegisterClass


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 2, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.