CButton::GetIcon

HICON GetIcon( ) const;

Return Value

A handle to an icon. NULL if no icon is previously specified.

Remarks

Call this member function to get the handle of an icon, previously set with SetIcon, that is associated with a button.

Example

CButton myButton;

// Create an icon button.
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_ICON, 
   CRect(10,10,60,50), pParentWnd, 1);

// If no icon is defined for the button, define the icon to the
// system error icon.
if (myButton.GetIcon() == NULL)
   myButton.SetIcon( ::LoadIcon(NULL, IDI_ERROR) );

CButton OverviewClass MembersHierarchy Chart

See Also   CButton::SetIcon, CBitmapButton::LoadBitmaps, Bitmaps