// 首先得到按钮句柄
CButton *pBunH;
pBunH = (CButton*)GetDlgItem( IDC_BUTTON2);
// 接下来得到图标句柄
HICON hBtnIcon;
// 方法1
//hBtnIcon = AfxGetApp()->LoadIconW( IDI_ICON3);
// 方法2
//hBtnIcon = LoadIconW( AfxGetApp()->m_hInstance, (LPCWSTR)IDI_ICON3);
// 方法3
hBtnIcon = LoadIconW( AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON3) );
// 为按钮设置图标
pBunH->SetIcon(hBtnIcon);
CButton *pBunH;
pBunH = (CButton*)GetDlgItem( IDC_BUTTON2);
// 接下来得到图标句柄
HICON hBtnIcon;
// 方法1
//hBtnIcon = AfxGetApp()->LoadIconW( IDI_ICON3);
// 方法2
//hBtnIcon = LoadIconW( AfxGetApp()->m_hInstance, (LPCWSTR)IDI_ICON3);
// 方法3
hBtnIcon = LoadIconW( AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDI_ICON3) );
// 为按钮设置图标
pBunH->SetIcon(hBtnIcon);