|
-
April 1st, 1999, 06:02 PM
#1
Wait cursor in dialog
How to displaying the hourglass cursor during some lengthy processing of a command handler implemented in dialog base application.
I've tried the BeginWaitCursor command, but like MSDN explain, the dialog box normally change the cursor to the standard arrow cursor, and leave the cursor in as the standard arrow cursor.
-
April 1st, 1999, 06:25 PM
#2
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
-
April 9th, 1999, 02:03 PM
#3
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|