SetCursor Problems !
-
Hi again, i call SetCursor(LoadCursor(NULL, IDC_WAIT)) in a (ListCtrl) Subroutine, but the Cursor doesn't change. How can i make it the right way ? Win2000 Prof, VS 6.0, SP2 Marco
to change the cursor, you need to handle the WM_SETCURSOR message. this will give you a OnSetCursor function. like this:
BOOL CPickAxeView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// make sure we only set the cursor if we're need to
if (pWnd==(CWnd *)this)
{
if (nHitTest==HTCLIENT)
{
if (message==WM_MOUSEMOVE)
{
SetCursor(AfxGetApp()->LoadStandardCursor(m_cursor));
return TRUE;
}
}
}return CView::OnSetCursor(pWnd, nHitTest, message);
}
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917 -
to change the cursor, you need to handle the WM_SETCURSOR message. this will give you a OnSetCursor function. like this:
BOOL CPickAxeView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// make sure we only set the cursor if we're need to
if (pWnd==(CWnd *)this)
{
if (nHitTest==HTCLIENT)
{
if (message==WM_MOUSEMOVE)
{
SetCursor(AfxGetApp()->LoadStandardCursor(m_cursor));
return TRUE;
}
}
}return CView::OnSetCursor(pWnd, nHitTest, message);
}
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917 -
Thanxs, i needed for the header of a listcontrol. If the cursor is over the header, then the standard cursor is shown. How can i catch the Listcontrol->Header->OnSetCursor routine ? Marco
you'll need to create a class derived from CHeaderCtrl, override OnSetCursor there, then use that class on your list control. -c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917 -
you'll need to create a class derived from CHeaderCtrl, override OnSetCursor there, then use that class on your list control. -c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
/. #3848917 -
Hi, sorry for my stupid question, but how can i "use that class on your list control" ? i have a created a new Class with modified OnSetCursor(), and then... ? Marco