Hello All, I am working on Property sheet wizard
based application .My problem is that i have to add bitmap to Next ,Back,Cancel
buttons of Property sheet.I used CBitmapButton Class and uses follwing approach
to add bitmap to buttons.
CButton *btnNext,*btnCancel,*btnHelp;
CBitmaputton btnBmpNext,btnBmpCancel,btnBmpNext;
// Get a handle
to each of the existing buttons btnCancel = reinterpret_cast<CButton
*>(GetDlgItem(IDCANCEL)); btnNext = reinterpret_cast<CButton
*>(GetDlgItem(ID_WIZNEXT)); btnHelp = reinterpret_cast<CButton
*>(GetDlgItem(IDHELP));
LONG GWLNext =
GetWindowLong(btnNext->m_hWnd,
GWL_STYLE); SetWindowLong(btnNext->m_hWnd, GWL_STYLE, GWLNext |
BS_OWNERDRAW); BOOL b=btnBmpNext.SubclassDlgItem(ID_WIZNEXT,
this); btnBmpNext.LoadBitmaps(IDB_SCAN_NORMAL,
IDB_SCAN_CLICK, IDB_SCAN_HOT, 0);
LONG GWLCancel =
GetWindowLong(btnCancel->m_hWnd,
GWL_STYLE); SetWindowLong(btnCancel->m_hWnd, GWL_STYLE, GWLCancel |
BS_OWNERDRAW); btnBmpCancel.SubclassDlgItem(IDCANCEL,
this); btnBmpCancel.LoadBitmaps(IDB_EXIT2,
IDB_EXIT_CLICKED, IDB_EXIT_FOCUS, 0);
LONG GWLHelp =
GetWindowLong(btnHelp->m_hWnd,
GWL_STYLE); SetWindowLong(btnHelp->m_hWnd, GWL_STYLE, GWLHelp |
BS_OWNERDRAW); btnBmpHelp.SubclassDlgItem(IDHELP,
this); btnBmpNext.LoadBitmaps(IDB_SCAN_NORMAL,
IDB_SCAN_CLICK, IDB_SCAN_HOT, 0); it successfully add bimap to next and
cancel button but when i navigate to next page by clicking next button bitmap on
next page does not remain on Next button and when i clicked back button the
bitmap applied on first page also got vanishes.
How to handle these
things as i am newto wizard type applications and doesnt know how to apply
bitmap for all pages of propertysheet.
waiting for reply soon as i am
struck in my project.
Thanks
|