HOWTO: Use Extra Fields in Window Class Structure

ID: Q10841


The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)
  • Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1


SUMMARY

To generate several child windows of the same class, each having its own set of static variables and independent of the sets of the variables in the sibling windows, you need to use the cbWndExtra field in WNDCLASS, the window-class data structure, when registering a window; then, use SetWindowWord() (or Long) and GetWindowWord() (or Long). These functions will either get or set additional information about the window identified by hWnd.

Use positive offsets as indexes to access any additional bytes that were allocated when the window class structure was created, starting at zero for the first byte of the extra space. Similarly, if you want to refer to bytes already defined by Windows within the structure, use offsets defined with the GWW and GWL prefixes.

Additional query words: win16sdk

Keywords : kbNTOS kbGrpUser kbWinOS kbWndw kbWndwClass kbWndwProp
Version :
Platform :
Issue type :


Last Reviewed: March 6, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.