Discussion:
how show Wait cursor for busy indication in WTL
(too old to reply)
Rajani
2004-01-20 09:46:05 UTC
Permalink
I have WTL application . On wizard finish function that is OnWizardFinish() function i have lengthy operation do . I need to show busy cusor. If i use SetCursor() the cursor is not restored to wait cursor if the mouse is moved out of the window and come back . I have derived the wizard from CPropertyPageImpl class . If wm_setcursor is handled it is not being called. Any help appreciated
Daniel Bowen
2004-01-20 19:49:52 UTC
Permalink
Post by Rajani
I have WTL application . On wizard finish function that is OnWizardFinish()
function i have lengthy operation do . I need to show busy cusor. If
i use SetCursor()
Post by Rajani
the cursor is not restored to wait cursor if the mouse is moved out
of the window and come back.
Post by Rajani
I have derived the wizard from CPropertyPageImpl class.
If wm_setcursor is handled it is not being called. Any help appreciated
If you do your work on the GUI thread (preventing messages from being
pumped), then try CWaitCursor (WTL 3.0+) or CCustomWaitCursor (WTL 7.1).

If messages are getting pumped while doing the lengthy operation, then
you have to be a little more creative. One option is to handle
WM_SETCURSOR for every window the mouse might move over. Another is to
set a message hook for WH_CALLWNDPROCRET, and force a wait cursor on
WM_SETCURSOR while the operation is going on.

-Daniel

Loading...