Change cursor from Toolbar (SetCursor?)

  • Thread starter Thread starter Arsen V.
  • Start date Start date
A

Arsen V.

Hello,

Whenever a certain action occurs (lets say OnDocumentComplete), I would like
my Rebar control to temporarily change the cursor from IDC_ARROW to a
resource cursor (it is stored as a resource inside of the DLL). I would like
the change cursor to be in effect for the *whole* browser window for 5
seconds. I would like the cursor to change back in 5 seconds.

What is the best way to accomplish this? Could you provide a few lines of
ATL with WTL (no MFC) example code?

Thanks in advance!
Arsen
 
Arsen V. said:
Whenever a certain action occurs (lets say OnDocumentComplete), I
would like my Rebar control to temporarily change the cursor from
IDC_ARROW to a resource cursor (it is stored as a resource inside of
the DLL). I would like the change cursor to be in effect for the
*whole* browser window for 5 seconds. I would like the cursor to
change back in 5 seconds.

You can just do

SetCursor(yourCursor);
Sleep(5000);
SetCursor(origCursor);

This will freeze the UI for 5 seconds though. If that's not what you
want, you need to install a Windows hook (see SetWindowsHookEx) and
intercept WM_SETCURSOR messages.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 
Hi Igor,

Yes, I do not want the UI to freeze.

With WM_SETCURSOR message I am only able to change the cursor while it is
pointing to the area of the toolbar. How can I do it for the whole IE
window?

Thanks,
Arsen
 
Arsen V. said:
With WM_SETCURSOR message I am only able to change the cursor while
it is pointing to the area of the toolbar. How can I do it for the
whole IE window?

Which part of "install a Windows hook" do you have difficulty
understanding?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top