itemState 表示需要绘画的状态,可选值如下ODS_CHECKED The menu item is to bechecked. This bit is used only in a menu. ODS_COMBOBOXEDIT The drawing takesplace in the selection field (edit control) of an owner-drawn combo box.ODS_DEFAULT The item is the default item. ODS_DISABLED The item is to be drawnas disabled. ODS_FOCUS The item has the keyboard focus. ODS_GRAYED The item isto be grayed. This bit is used only in a menu. ODS_SELECTED The menu item‘sstatus is selected.; hwndItem 表示控件的句柄; hDC 表示控件的DC; rcItem 表示控件的矩形区域; itemData 控件的附加信息;
实现功能
1.新建基于对话框的应用程序
2.从Cbutton派生一个自已的类CImageBtn;并添加三个变量private:CImageList*m_pImagelist; //图像列表指针 int m_nImageIndex; //图标索引BOOL m_bIsPressed; //按钮是否被按下;构造函数中初始化m_bIsPressed = FALSE;