CWaitCursor
-
Hi, could anyone give me an answer to this. We have a long operation involving that we have wrapped with a CWaitCursor. However, during the processing, the cursor flickers back and forward to the pointer. Any ideas what we can do to keep the hourglass visible? Cheers, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }
-
Hi, could anyone give me an answer to this. We have a long operation involving that we have wrapped with a CWaitCursor. However, during the processing, the cursor flickers back and forward to the pointer. Any ideas what we can do to keep the hourglass visible? Cheers, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }
-
Whenever you window need redraw, the cursor is updated. If you want to stick to your CWaitCursor, you need to overwrite SetCursor().
Ahhhh, documentation. Maybe I should have read it in the first place. Thanx for your help. Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }
-
Ahhhh, documentation. Maybe I should have read it in the first place. Thanx for your help. Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }
I think it's simpler to just do:
AfxGetApp()->DoWaitCursor(1);
doSomething();
AfxGetApp()->DoWaitCursor(-1);/ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com
-
Hi, could anyone give me an answer to this. We have a long operation involving that we have wrapped with a CWaitCursor. However, during the processing, the cursor flickers back and forward to the pointer. Any ideas what we can do to keep the hourglass visible? Cheers, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }
If fact, temporary cursor are restored as soon as the mouse is moved (see SetCursor doc) and in pratice, it means that the cursor will be restored if windows messages are processed which may be the case if something with a message loop is called (COM apartment switching, message box,...). The only way to ensure that the wait cursor stay displayed is by calling something that will do a permanent change of the cursor (or also by processing WM_SETCURSOR) or by associating a NULL cursor with your window. In MSDN documentation, it is said that the cursor must be restored if an operation cause the cursor to be changed (see CWaitCursor::Restore). Philippe Mori