Set cursor to hourglass before window appears
-
Hello, My application is pretty heavy. It takes about 10 seconds until it's shown to the user, until then, the user don't see a thing. I want to change the cursor to hourglass before the window is shown. BTW, my window is created, I just don't show it, until all its components are loaded. How can I implement this? I tried to use SetCursor, but when I move my mouse over the background windows it changes back to arrow right away. Thanks, Meni.
-
Hello, My application is pretty heavy. It takes about 10 seconds until it's shown to the user, until then, the user don't see a thing. I want to change the cursor to hourglass before the window is shown. BTW, my window is created, I just don't show it, until all its components are loaded. How can I implement this? I tried to use SetCursor, but when I move my mouse over the background windows it changes back to arrow right away. Thanks, Meni.
If you are using MFC, create a CWaitCursor object, it will manage the hour glass as long as the object is instantiated.
{ CWaitCursor waitCursor; <some lengthy operation> }
Change of fashion is the tax levied by the industry of the poor on the vanity of the rich Fold with us! ¤ flickr
-
If you are using MFC, create a CWaitCursor object, it will manage the hour glass as long as the object is instantiated.
{ CWaitCursor waitCursor; <some lengthy operation> }
Change of fashion is the tax levied by the industry of the poor on the vanity of the rich Fold with us! ¤ flickr
-
Then I guess you have to catch the WM_SETCURSOR message and set the cursor to the waitcursor according to a boolean attribute of your window - cf http://blogs.msdn.com/oldnewthing/archive/2005/05/25/421707.aspx[^]
Change of fashion is the tax levied by the industry of the poor on the vanity of the rich Fold with us! ¤ flickr
-
Hello, My application is pretty heavy. It takes about 10 seconds until it's shown to the user, until then, the user don't see a thing. I want to change the cursor to hourglass before the window is shown. BTW, my window is created, I just don't show it, until all its components are loaded. How can I implement this? I tried to use SetCursor, but when I move my mouse over the background windows it changes back to arrow right away. Thanks, Meni.
Hi, I guess your Application Window is not shown till all of the component get loaded. setCursor has effect for the window only, since the window is not actually shown, set cursor won't have effect. I think typically scenarios are handled by "Splash Screens". A simple window, its sole purpose is to give the user a feel that application has started and also it can show the progress of loading. Try Something like splash screens. Best Regards Raj
-
Then I guess you have to catch the WM_SETCURSOR message and set the cursor to the waitcursor according to a boolean attribute of your window - cf http://blogs.msdn.com/oldnewthing/archive/2005/05/25/421707.aspx[^]
Change of fashion is the tax levied by the industry of the poor on the vanity of the rich Fold with us! ¤ flickr
The problem is that: when the window is still invisible and I set the cursor to hourglass, even if i'll alter the WM_SETCURSOR handling it won't solve it, because my window doesn't get the WM_SETCURSOR messages, because the mouse is over other windows! How can I implement it, so no matter where my cursor is, it'll show an hourglass cursor. Thanks you.
-
Hi, I guess your Application Window is not shown till all of the component get loaded. setCursor has effect for the window only, since the window is not actually shown, set cursor won't have effect. I think typically scenarios are handled by "Splash Screens". A simple window, its sole purpose is to give the user a feel that application has started and also it can show the progress of loading. Try Something like splash screens. Best Regards Raj
-
Before going to splash screen strategy, where did you find that icons are applied on windows only? Can you please send a link? How about lets say capturing the mouse (or something) and then set the icon?
That doesn't really need a link - its pretty obvious in today's forced multi tasking environment. The window the mouse is over gets the WM_SETCURSOR messages. The only way to do your plan is to create a transparent window covering up the whole desktop (which can be a headache on a multimonitor system), or just simply do a splash screen. The splash screen has the advantage of being able to display some sort of progress as your application initialises bit-by-bit. Iain.
-
Before going to splash screen strategy, where did you find that icons are applied on windows only? Can you please send a link? How about lets say capturing the mouse (or something) and then set the icon?
Hi, Please search for links. Simply think can you set cursor for non window application application. Mouse capture is released when the user explicitly switched to next application(for eg: pressing WINDOWS key, Alt + tab), this can happen as your application is not started in 10 seconds.
-
Hello, My application is pretty heavy. It takes about 10 seconds until it's shown to the user, until then, the user don't see a thing. I want to change the cursor to hourglass before the window is shown. BTW, my window is created, I just don't show it, until all its components are loaded. How can I implement this? I tried to use SetCursor, but when I move my mouse over the background windows it changes back to arrow right away. Thanks, Meni.
use 'BeginWaitCursor()'and 'EndWaitCursor()' between these two function calls write ur body of the function. the moment it calls the BeginWaitCursor() arrow cursor will change into hour glass and when it reaches EndWaitCursor() hour glass will change into arrow cursor. for ex: void C01Dlg::OnRelay() { BeginWaitCursor(); // //your function body // // EndWaitCursor(); } wherever you move ur mouse pointer it will be a hour glass only.. try it out. ok.. bye. -- modified at 7:48 Tuesday 26th June, 2007
regards sudhakar