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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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(CWn d* pWnd, UINT nHitTest, UINT message)
{
switch(m_mouseRegion) {
case DISP_CURRENT:
SetCursor(AfxGetApp()->Loa dStandardC ursor(IDC_ SIZEWE));
return TRUE;
case NONE:
if( m_pInstInfo && m_pRuler && (m_editRegion == NONE) &&
m_pInstInfo->CommandGet() == CInstInfo::CMD_STOP) {
SetCursor(AfxGetApp()->Loa dCursor(ID C_ZOOM));
}
return TRUE;
}
return CWnd::OnSetCursor(pWnd, nHitTest, message);
}
In the meantime here's an example from my app:
BOOL CGBarTime::OnSetCursor(CWn
{
switch(m_mouseRegion) {
case DISP_CURRENT:
SetCursor(AfxGetApp()->Loa
return TRUE;
case NONE:
if( m_pInstInfo && m_pRuler && (m_editRegion == NONE) &&
m_pInstInfo->CommandGet() == CInstInfo::CMD_STOP) {
SetCursor(AfxGetApp()->Loa
}
return TRUE;
}
return CWnd::OnSetCursor(pWnd, nHitTest, message);
}
ASKER
Wooo
that worked :)
thanx alot
btw, what program are you writting?
that worked :)
thanx alot
btw, what program are you writting?
ASKER
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?