Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SubclassWindow
CWnd                                        Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Windows 3.1 only
 
  BOOL SubclassWindow( HWND hwnd );
 
  Parameter   Description
 
  <hwnd>      A handle to the window.
 
  Remarks
 
  Attaches a window to a CWnd object and replaces the window's WndProc and
  AfxWndProc. It stores the old WndProc in the location returned by
  GetSuperWndProc, which is used for default message processing (see
  CWnd::DefWindowProc). You must override GetSuperWndProcAddr for every
  unique window class to provide a place to store the old WndProc.
 
  The operation of replacing a WndProc with a new one, saving the old one
  and calling it a "super class," is known as "dynamically subclassing" a
  window.
 
  Return Value
 
  TRUE if the function is successful; otherwise, FALSE.
 
  See Also
 
  CWnd::GetSuperWndProcAddr, CWnd::Attach
 
 
                                     -♦-