-
Re: CWaitCursor issue
I managed to get something almost good :
Code:
HCURSOR normalCursor = GetCursor();
HCURSOR waitCursor = ::LoadCursor(NULL, IDC_WAIT);
HCURSOR waitCursorCopy = CopyCursor(waitCursor);
cursorChange = SetSystemCursor(waitCursorCopy, 32512);
// Init processing
HCURSOR normalCursorCopy = CopyCursor(normalCursor);
cursorChange = SetSystemCursor(normalCursorCopy, 32512);
This displays the hour glass while processing but doesn't restore the original normal cursor despite all cursor handles being != 0 and SetSystemCursor returning TRUE.
If I replace the normalCursor handle by a cursor in the application resources it works.
Code:
HCURSOR normalCursor = LoadCursor(IDC_MY_CURSOR);
Any ideas ?
-
Re: CWaitCursor issue
This is purely a guess and I may be wrong - but is it possible that CWaitCursor will only work when called from an object that's a window? CWinApp is not a window and this might be why you're having the problem. Try moving the call to somewhere more appropriate (e.g. OnInitDialog() if the app was dialog based).
As I said, I might be wrong but there's something ringing a bell in the back of my mind... :wave: