CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Feb 2008
    Posts
    138

    [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

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    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.

  3. #3
    Join Date
    Feb 2008
    Posts
    138

    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???
    Last edited by techie.ashish; October 15th, 2008 at 04:44 AM.

  4. #4
    Join Date
    Feb 2008
    Posts
    138

    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..

  5. #5
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    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 ?

  6. #6
    Join Date
    Feb 2008
    Posts
    138

    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...

  7. #7
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    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.

  8. #8
    Join Date
    Feb 2008
    Posts
    138

    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???

  9. #9
    Join Date
    Feb 2008
    Posts
    138

    Re: Busy Mouse cursor when using AnimateWindow.

    And yes i'm not handling WM_SETCURSOR. Thought window would handle it..

    I'll try..

  10. #10
    Join Date
    Feb 2008
    Posts
    138

    Unhappy 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

  11. #11
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    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.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  12. #12
    Join Date
    Feb 2008
    Posts
    138

    Re: Busy Mouse cursor when using AnimateWindow.

    Alright.. Uploaded the project... Please take a look..

    Thanks.
    Attached Files Attached Files
    Last edited by techie.ashish; October 18th, 2008 at 01:17 AM.

  13. #13
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Busy Mouse cursor when using AnimateWindow.

    It's an incomplete project. Does it compile and run at all ?

  14. #14
    Join Date
    Feb 2008
    Posts
    138

    Re: Busy Mouse cursor when using AnimateWindow.

    Well might be...Anyways included a sample project..Hope this will compile...

    Thanks.
    Attached Files Attached Files

  15. #15
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    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.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured