HOWTO: Use DWL_USER to Access Extra Bytes in a Dialog Box

ID: Q88358


The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK)
  • Microsoft Win32 Software Development Kit (SDK)
  • Microsoft Windows 2000


SUMMARY

Windows extra bytes are used to store private information specific to an instance of a window. For dialog boxes, these extra bytes are already allocated by the dialog manager. The offset to the extra byte location is called DWL_USER.

DWL_USER is the 8th byte offset of the dialog extra bytes. The programmer has 4 bytes (a long) available from this offset for personal use.

CAUTION: DO NOT use more than 4 bytes of these extra bytes, as the rest of them are used by the dialog manager.

Example


   DWORD dwNumber = 10;
            .
            .
            .
            .
   case WM_INITDIALOG:
           SetWindowLong(hWnd,DWL_USER,dwNumber); // Store value 10 at
                                                  // byte offset 8
           dwNumber = GetWindowLong(hWnd,DWL_USER); // Retrieve the value 
NOTE: GetWindowWord and SetWindowWord could be used instead.

Additional query words:

Keywords : kbDlg kbNTOS kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS kbWndw kbWndwProp
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: January 26, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.