How To Change The Mouse Pointer Over A Button At Runtime

How To Change The Mouse Pointer Over A Button At Runtime


  • 21 Jan, 2012

    Assuming that you have set the button's ID as IDC_BTNSAMPLE in the resource editor :-// You have to handle the WM_SETCURSOR message handler to do thatBOOL CTestDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message){if (pWnd == GetDlgItem(IDC_BTNSAMPLE)) { // To load a standard cursor::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));// To load your own custom cursor. Assuming that you have created a// Cursor in the resource editor and named it as IDC_CURSAMPLE::SetCursor(AfxGetApp()->LoadCursor(MAKEINTRESOURCE(IDC_CURSAMPLE)));// Remember to return TRUE here return TRUE; }return CDialog::OnSetCursor(pWnd, nHitTest, message);}

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.