When the application registers the window class, it may reserve extra space in the window structure for application data specific to this particular class of windows. To store and retrieve data in this extra space, the application uses the functions GetWindowWord, SetWindowWord, GetWindowLong, and SetWindowLong.
If the application must maintain a large amount of data for a document window, the application can allocate memory for a data structure and then store the handle of the structure in the extra space of the window structure.
Multipad uses this technique. For example, the WM_CREATE message processing in the Multipad window procedure MPChildWndProc creates a multiline edit control used as the text-editor window. Multipad stores the handle to this edit control in its child window structure by using the SetWindowWord function. Whenever Multipad must use the edit control, it calls the GetWindowWord function to retrieve the handle of the edit control. Multipad maintains several per-document variables this way.