I am totally newbie in C++ and I need to edit C++ softare. I need to replace GUI buttons graphics with image icons. I am not sure, but maybe Button is created in this part of code:
BOOL CButtonDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetDlgItemText(IDC_BUTTON_LOAD,_T("Load"));
return TRUE;
}
When I am looking into code I see buttons are enabled with such a code:
m_dButtondlg.GetDlgItem(IDC_BUTTON_LOAD)->EnableWindow(true);
Where IDC_BUTTON_LOAD is integer constatnt. I cannot find any other usage of the constant in code, so I am not sure how the button was created. I just know that
m_dButtondlg.GetDlgItem(IDC_BUTTON_LOAD)
returns pointer to CWnd
How can I attach images to button, using CWnd object?
EDIT: I have found out, that button identified with IDC_BUTTON_LOAD is instance of derived class of CDIalog, not CButton.
Best way is that you convert your CWnd pointer to CButton like shown in below,
And you can easily load image on CButton object.
EDIT
Code to load bitmap on CButton,