Click here to Skip to main content
Licence 
First Posted 17 Apr 2000
Views 167,794
Bookmarked 116 times

Animated Dialog Windows

By | 17 Apr 2000 | Article
A class that provides some simple, yet spectacular window animation effects. Try the demo!
  • Download demo project - 24 Kb
  • Download source files - 5 Kb

    animated screen shot

    Introduction

    Often in modern GUI you can see a some sort of window or menu animation that can give a more user friendly "cool" look. Fading or sliding menus, poping dialog boxes look neat and provide visual feedback with user actions. Currently, however there is no simple way to do this under MS Windows, other than XORed lines and polygons (besides the AnimateWindow() function).

    The AnimEffect class provides quite an easy and extensible way to add animation to your code.

    Usage

    Using the class is rather simple. Just add the following code to the dialogs OnCreate and OnDestroy functions.

     AnimEffect ef;
     // exploding window effect
     ef.Open( rcWnd );
     // or imploding window effect
     ef.Close( rcWnd );
    

    You can customize the effect by calling the Setup( int iSteps, int iAfterimages, int iDelay ) member function, and change the animation type by Effect( EffectType effect ), where EffectType is :

       enum EffectType {
         Random=-1,       // default
         Spin=0,          
         Vortex,
         ScatterGather,
         Spike,
         Fireworks
       };
    

    Included is a simple demo project that shows a bunch of effects. Feel free to use this code.

  • License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Anton Stuck



    Russian Federation Russian Federation

    Member



    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralIt won't work with Vista Aero Pinmemberjulio.debroy13:19 16 Oct '07  
    GeneralGreat code PinmemberEl Chapulin Colorado1:17 3 May '07  
    GeneralSIMPLY PinmemberHugo.Pereira1:25 21 Dec '06  
    GeneralHats off PinmemberBalkrishna Talele22:41 11 Dec '03  
    GeneralI bow before thy creativity Pinmemberabhinaba18:42 10 Dec '03  
    GeneralAmazing! PinsussT.S. Prasad18:04 21 Apr '03  
    GeneralI finally found this class! PinmemberiProgram (WangYue)23:26 12 Jan '03  
    GeneralThis is soooo cooool !! PinmemberWREY23:21 27 Sep '02  
    GeneralOnly one little note... PinsussAV21:34 9 Oct '00  
    GeneralRe: Only one little note... PinmemberJoephia6:33 1 Sep '08  
    Questionset position od adialog ? PinsussKhoa Vinh17:16 10 Aug '00  
    Questionset position od adialog ? PinsussKhoa Vinh17:15 10 Aug '00  
    GeneralSpeed PinsussGeorge7:37 6 May '00  
    GeneralRe: Speed Pinmembertiaozi2:02 25 May '02  
    GeneralRe: Speed Pinmemberxiangjs6:01 27 Feb '03  
    GeneralAwesome! PinsussDuc Truong14:03 26 Apr '00  
    Generalwhen ondestroy, leaves lines behind PinsussMartin18:59 18 Apr '00  
    GeneralRe: when ondestroy, leaves lines behind Pinsussflight11:41 19 Apr '00  
    GeneralRe: when ondestroy, leaves lines behind PinsussGeorge8:37 29 Apr '00  
    >Also, my OnCreate function will always display the
    >animation the correct size but at 0,0:
     
    Put the code into OnShowWindow (WM_SHOWWINDOW).
     
    Good Luck!
    GeneralRe: when ondestroy, leaves lines behind PinsussSimon Brown0:10 12 May '00  
    GeneralRe: when ondestroy, leaves lines behind PinsussFuMo14:00 12 Jun '00  
    GeneralRe: when ondestroy, leaves lines behind PinsussRainer Koschnick12:34 5 Sep '00  
    General:) PinsussAlex Turc8:31 18 Apr '00  
    Questionsystem hook???? PinsussLJP5:01 18 Apr '00  
    AnswerRe: system hook???? PinsussChris Maunder12:52 18 Apr '00  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web02 | 2.5.120529.1 | Last Updated 18 Apr 2000
    Article Copyright 2000 by Anton Stuck
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid