[RESOLVED] Busy Mouse cursor when using AnimateWindow.
Hi all..
I've a dialog box in which i'm using AnimateWindow. Everything is OK but whenever my dialog Animate(Up to down in may case with the help of)
Code:
AnimateWindow(hWnd, 300, AW_SLIDE | AW_VER_NEGATIVE);
My mouse just gets busy if i put on Dialog Box.. I mean busy Icon and i can't click on any of the control inside it..
I know it's refreshing everytime it moves. But how can i overcome this problem..
Thanks all
Re: Busy Mouse cursor when using AnimateWindow.
That is expected. AnimateWindow is expected to do what it needs for the duration you specify i.e. for 300 milliseconds it will do the animation and in that time, it will show a wait cursor. That is the expected behavior.
Re: Busy Mouse cursor when using AnimateWindow.
Yeah That is expected.. But when it stop for 4 seconds the mouse cursor remains same (i.e BUSY).. I mean isn't there any way to click on control after playing animation???
Re: Busy Mouse cursor when using AnimateWindow.
Do i need to update or invalidate the Window when animatewindow stops??
I tried that but no success. Can someone throw any light on that??
Thanks..
Re: Busy Mouse cursor when using AnimateWindow.
Quote:
Originally Posted by techie.ashish
Yeah That is expected.. But when it stop for 4 seconds the mouse cursor remains same (i.e BUSY).. I mean isn't there any way to click on control after playing animation???
Hm.. you mean, when the animation has stopped, the cursor still shows up as busy ?
Re: Busy Mouse cursor when using AnimateWindow.
Yes Kirants..
That's what i mean... I don't need to click anything when it plays animation. But when it stops it shows the same cursor..
I'm updating the window when it stops animation...
Re: Busy Mouse cursor when using AnimateWindow.
That is wierd. Please post a sample project that exhibits your behavior. I am guessing you aren't handling WM_SETCURSOR anywhere in your code.
Re: Busy Mouse cursor when using AnimateWindow.
Hi kirants..
Do i need to forcibly change the cursor?? Shouldn't window show appropriate cursor? I mean when animate window plays the animation window should change the cursor to normal one.. Right???
Re: Busy Mouse cursor when using AnimateWindow.
And yes i'm not handling WM_SETCURSOR. Thought window would handle it..
I'll try..
Re: Busy Mouse cursor when using AnimateWindow.
WM_SETCURSOR and SetCursor does change the cursor but i believe the window is still busy.. That's why not picking any of the messages.. When i set the cursor it changes but after that when i click on dialog it didn't handle WM_LBUTTONDOWN message. Same behavior when the dialog was busy..
I'm becoming Clueless
Re: Busy Mouse cursor when using AnimateWindow.
Like Kirants said, please post a sample project that exhibits your behavior so we can take a look at the code you are using.
1 Attachment(s)
Re: Busy Mouse cursor when using AnimateWindow.
Alright.. Uploaded the project... Please take a look..
Thanks.
Re: Busy Mouse cursor when using AnimateWindow.
It's an incomplete project. Does it compile and run at all ?
1 Attachment(s)
Re: Busy Mouse cursor when using AnimateWindow.
Well might be...Anyways included a sample project..Hope this will compile...
Thanks.
Re: Busy Mouse cursor when using AnimateWindow.
You get the hourglass because you don't let the window process any messages. In your WM_INITDIALOG you show the window, then sleep 5 seconds and hide the window and call EndDialog immediately. So the system doesn't get the time to change the cursor.
Do not do it like this.
Instead, when your window is fully shown, install a timer of 5 seconds (SetTimer) and handle WM_TIMER message. In that message hide the dialog.