Click here to Skip to main content
6,594,432 members and growing! (16,887 online)
Email Password   helpLost your password?
Multimedia » GDI » General     Intermediate

Animated Dialog Windows

By Anton Stuck

A class that provides some simple, yet spectacular window animation effects. Try the demo!
VC6WinXP, MFC, GDI, Dev
Posted:17 Apr 2000
Views:140,971
Bookmarked:96 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
98 votes for this article.
Popularity: 9.43 Rating: 4.73 out of 5
1 vote, 3.0%
1
1 vote, 3.0%
2

3
3 votes, 9.1%
4
28 votes, 84.8%
5
  • 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


    Member

    Location: Russian Federation Russian Federation

    Other popular GDI articles:

    Article Top
    You must Sign In to use this message board.
    FAQ FAQ 
     
    Noise Tolerance  Layout  Per page   
     Msgs 1 to 25 of 29 (Total in Forum: 29) (Refresh)FirstPrevNext
    GeneralIt won't work with Vista Aero Pinmemberjulio.debroy14:19 16 Oct '07  
    GeneralGreat code PinmemberEl Chapulin Colorado2:17 3 May '07  
    GeneralSIMPLY PinmemberHugo.Pereira2:25 21 Dec '06  
    GeneralHats off PinmemberBalkrishna Talele23:41 11 Dec '03  
    GeneralI bow before thy creativity Pinmemberabhinaba19:42 10 Dec '03  
    GeneralAmazing! PinsussT.S. Prasad19:04 21 Apr '03  
    GeneralI finally found this class! PinmemberiProgram (WangYue)0:26 13 Jan '03  
    GeneralThis is soooo cooool !! PinmemberWREY0:21 28 Sep '02  
    GeneralOnly one little note... PinsussAV22:34 9 Oct '00  
    GeneralRe: Only one little note... PinmemberJoephia7:33 1 Sep '08  
    Generalset position od adialog ? PinsussKhoa Vinh18:16 10 Aug '00  
    Generalset position od adialog ? PinsussKhoa Vinh18:15 10 Aug '00  
    GeneralSpeed PinsussGeorge8:37 6 May '00  
    GeneralRe: Speed Pinmembertiaozi3:02 25 May '02  
    GeneralRe: Speed Pinmemberxiangjs7:01 27 Feb '03  
    GeneralAwesome! PinsussDuc Truong15:03 26 Apr '00  
    Generalwhen ondestroy, leaves lines behind PinsussMartin19:59 18 Apr '00  
    GeneralRe: when ondestroy, leaves lines behind Pinsussflight12:41 19 Apr '00  
    GeneralRe: when ondestroy, leaves lines behind PinsussGeorge9:37 29 Apr '00  
    GeneralRe: when ondestroy, leaves lines behind PinsussSimon Brown1:10 12 May '00  
    GeneralRe: when ondestroy, leaves lines behind PinsussFuMo15:00 12 Jun '00  
    GeneralRe: when ondestroy, leaves lines behind PinsussRainer Koschnick13:34 5 Sep '00  
    General:) PinsussAlex Turc9:31 18 Apr '00  
    Generalsystem hook???? PinsussLJP6:01 18 Apr '00  
    GeneralRe: system hook???? PinsussChris Maunder13:52 18 Apr '00  

    General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    PermaLink | Privacy | Terms of Use
    Last Updated: 17 Apr 2000
    Editor: Chris Maunder
    Copyright 2000 by Anton Stuck
    Everything else Copyright © CodeProject, 1999-2009
    Web16 | Advertise on the Code Project