Link to home
Start Free TrialLog in
Avatar of police1
police1

asked on

Changing mouse cursor

I was wondering if anyone knows how to change the mouse cursor at run time?
I put  "SetCursor(m_hIcon);  in the mouse move event,  it works and everything, but it flashes, and it doesn't do it over command buttons, menus n'shit...   does anyone know how to make it changed for the program?
ASKER CERTIFIED SOLUTION
Avatar of plaroche
plaroche

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of police1
police1

ASKER

Well, I'm not gonna accept this anwer yet...
the reason why.. is because it didn't work.  :(
I put in the onsetcursor thingy.. and took out the mouse move event... and put the set cursor in the onsetcursor... and it did nothing at all.

not even a bit.

Do you know where I could get an example for this?

You can check the doc with devstudio, there surely are samples that show how it works. Try a query for WM_SETCURSOR or OnSetCursor.

In the meantime here's an example from my app:
BOOL CGBarTime::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
    switch(m_mouseRegion) {
    case DISP_CURRENT:
        SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZEWE));
        return TRUE;

    case NONE:
        if( m_pInstInfo && m_pRuler && (m_editRegion == NONE) &&
            m_pInstInfo->CommandGet() == CInstInfo::CMD_STOP) {
            SetCursor(AfxGetApp()->LoadCursor(IDC_ZOOM));
        }
        return TRUE;
    }

      return CWnd::OnSetCursor(pWnd, nHitTest, message);
}



Avatar of police1

ASKER

Wooo
that worked  :)
thanx alot

btw, what program are you writting?