Loading Icon in a Property Sheet Button
-
hi: i am using the following code to load an icon for the ok button of the property sheet but this is not woking //////////////OnInitDialog////////////////////////////// BOOL CMyPropertySheet::OnInitDialog() { BOOL bResult = CPropertySheet::OnInitDialog(); // other code CButton* pButt=(CButton*)GetDlgItem(IDOK); CWinApp* pApp=AfxGetApp(); HICON hIcon=::LoadIcon(pApp->m_hInstance,MAKEINTRESOURCE(IDI_CLOSE)); if(hIcon==NULL) AfxMessageBox("null handle of icon"); pButt->SetIcon(hIcon); return bResult; } ///////////////////////////////////////////////////////// i cant see the icon ..can any one help me.... thanks Ahmed:( ahmed
-
hi: i am using the following code to load an icon for the ok button of the property sheet but this is not woking //////////////OnInitDialog////////////////////////////// BOOL CMyPropertySheet::OnInitDialog() { BOOL bResult = CPropertySheet::OnInitDialog(); // other code CButton* pButt=(CButton*)GetDlgItem(IDOK); CWinApp* pApp=AfxGetApp(); HICON hIcon=::LoadIcon(pApp->m_hInstance,MAKEINTRESOURCE(IDI_CLOSE)); if(hIcon==NULL) AfxMessageBox("null handle of icon"); pButt->SetIcon(hIcon); return bResult; } ///////////////////////////////////////////////////////// i cant see the icon ..can any one help me.... thanks Ahmed:( ahmed
Is Your porpertysheet in WIZARD MODE ???? CodeTheDreams();
-
Is Your porpertysheet in WIZARD MODE ???? CodeTheDreams();
hi: the issue is solved it should have been like CButton* pButt=(CButton*)GetDlgItem(IDOK); DWORD newstyle = ::GetWindowLong(pButt->m_hWnd, GWL_STYLE) | BS_ICON; ::SetWindowLong(pButt->m_hWnd, GWL_STYLE, newstyle); CWinApp* pApp=AfxGetApp(); HICON hIcon=::LoadIcon(pApp->m_hInstance,MAKEINTRESOURCE(IDI_CLOSE)); if(hIcon==NULL)AfxMessageBox("null icon"); pButt->SetIcon(hIcon); return bResult;:) thanks ahmed