Re: Wait cursor in dialog
The nicest way is to use CWaitCursor, like this:
void CMyDlg::OnLengthyOperation()
{
CWaitCursor wait; // set wait cursor
....
} // restore cursor (on destruction)
Alvaro
Re: Wait cursor in dialog
The point is that there is function
OnSetCursor and each time u move mouse it restores old cursor. To prevent that u need:
1st: set wait cursor by
m_hCurrentCursor = AfxGetApp()->LoadStandardCursor(IDC_WAIT));
SetCursor(m_hCurrentCursor);
2nd: Overwrite function OnSetCursor in ur dialog or not dialog based application and put there code:
BOOL CUrViewOrDialog::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
SetCursor(m_hCurrentCursor);
return TRUE;
//return CScrollView::OnSetCursor(pWnd, nHitTest, message);
}
When u need to set old cursor place next code:
m_hCurrentCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
SetCursor(m_hCurrentCursor);
WBR Oak