Microsoft KB Archive/88358

{|
 * width="100%"|

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

 * }

Q88358

-

The information in this article applies to:


 * Microsoft Windows Software Development Kit (SDK)
 * Microsoft Win32 Software Development Kit (SDK)

-

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 kbOSWinNT kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin kbWndw kbWndwProp

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch kbWinSDKSearch