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.
CButton::Create
CButton                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  BOOL Create( const char FAR* lpCaption, DWORD dwStyle,
               const RECT& rect, CWnd* pParentWnd, UINT nID );
 
  Parameter    Description
 
  <lpCaption>  Specifies the button control's text.
 
  <dwStyle>    Specifies the button control's style.
 
  <rect>       Specifies the button control's size and position. It can be
               either a CRect object or a RECT structure.
 
  <pParentWnd> Specifies the button control's parent window, usually a
               CDialog or CModalDialog. It must not be NULL.
 
  <nID>        Specifies the button control's resource ID.
 
  Remarks
 
  You construct a CButton object in two steps. First call the constructor,
  then call Create, which creates the Windows button control and attaches
  it to the CButton object.
 
  When Create executes, Windows sends the WM_NCCREATE, WM_CREATE,
  WM_NCCALCSIZE, and WM_GETMINMAXINFO messages to the button control.
 
  These messages are handled by default by the OnNcCreate, OnCreate,
  OnNcCalcSize, and OnGetMinMaxInfo member functions in the CWnd base
  class. To extend the default message handling, derive a class from
  CButton, add a message map to the new class, and override the preceding
  message-handler member functions. Override OnCreate, for example, to
  perform needed initialization for a new class.
 
  To handle Windows notification messages that the CButton object sends to
  its parent, add any of the following message-map entries that you want
  to process to the parent-class message map:
 
  ON_COMMAND
  ON_BN_CLICKED
  ON_BN_DOUBLECLICKED
 
  Apply the following window styles to a button control:
 
  Style        Application
 
  WS_CHILD     Always.
 
  WS_VISIBLE   Usually.
 
  WS_DIABLED   Rarely.
 
  WS_GROUP     To group controls.
 
  WS_TABSTOP   To include the button in the tabbing order.
 
  Apply any combination of button styles to the button.
 
  Return Value
 
  TRUE if successful; otherwise FALSE.
 
  See Also
 
  CButton::CButton
 
 
                                     -♦-