Click here to Skip to main content
11,928,078 members (27,715 online)
Click here to Skip to main content
Add your own
alternative version


123 bookmarked

Animated Dialog Windows

, 17 Apr 2000
Rate this:
Please Sign up or sign in to vote.
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


    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.


    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

    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
    No Biography provided

    You may also be interested in...

    Comments and Discussions

    GeneralMy vote of 5 Pin
    sariqkhan21-Nov-12 2:29
    membersariqkhan21-Nov-12 2:29 
    GeneralIt won't work with Vista Aero Pin
    julio.debroy16-Oct-07 14:19
    memberjulio.debroy16-Oct-07 14:19 
    GeneralGreat code Pin
    El Chapulin Colorado3-May-07 2:17
    memberEl Chapulin Colorado3-May-07 2:17 
    GeneralSIMPLY Pin
    Hugo.Pereira21-Dec-06 2:25
    memberHugo.Pereira21-Dec-06 2:25 
    GeneralHats off Pin
    Balkrishna Talele11-Dec-03 23:41
    memberBalkrishna Talele11-Dec-03 23:41 
    GeneralI bow before thy creativity Pin
    abhinaba10-Dec-03 19:42
    memberabhinaba10-Dec-03 19:42 
    GeneralAmazing! Pin
    T.S. Prasad21-Apr-03 19:04
    sussT.S. Prasad21-Apr-03 19:04 
    GeneralI finally found this class! Pin
    iProgram (WangYue)13-Jan-03 0:26
    memberiProgram (WangYue)13-Jan-03 0:26 
    GeneralThis is soooo cooool !! Pin
    WREY28-Sep-02 0:21
    memberWREY28-Sep-02 0:21 
    GeneralOnly one little note... Pin
    AV9-Oct-00 22:34
    sussAV9-Oct-00 22:34 
    GeneralRe: Only one little note... Pin
    Joephia1-Sep-08 7:33
    memberJoephia1-Sep-08 7:33 
    Questionset position od adialog ? Pin
    Khoa Vinh10-Aug-00 18:16
    sussKhoa Vinh10-Aug-00 18:16 
    Questionset position od adialog ? Pin
    Khoa Vinh10-Aug-00 18:15
    sussKhoa Vinh10-Aug-00 18:15 
    GeneralSpeed Pin
    George6-May-00 8:37
    sussGeorge6-May-00 8:37 
    GeneralRe: Speed Pin
    tiaozi25-May-02 3:02
    membertiaozi25-May-02 3:02 
    GeneralRe: Speed Pin
    xiangjs27-Feb-03 7:01
    memberxiangjs27-Feb-03 7:01 
    GeneralAwesome! Pin
    Duc Truong26-Apr-00 15:03
    sussDuc Truong26-Apr-00 15:03 
    Generalwhen ondestroy, leaves lines behind Pin
    Martin18-Apr-00 19:59
    sussMartin18-Apr-00 19:59 
    GeneralRe: when ondestroy, leaves lines behind Pin
    flight19-Apr-00 12:41
    sussflight19-Apr-00 12:41 
    GeneralRe: when ondestroy, leaves lines behind Pin
    George29-Apr-00 9:37
    sussGeorge29-Apr-00 9:37 
    GeneralRe: when ondestroy, leaves lines behind Pin
    Simon Brown12-May-00 1:10
    sussSimon Brown12-May-00 1:10 
    I also have this problem, and am going to try to resolve it. My method of attack will be to send a repaint message (or whatever) to all toplevel windows.

    I have the code to do this somewhere, once I do it I'll post it here.

    GeneralRe: when ondestroy, leaves lines behind Pin
    FuMo12-Jun-00 15:00
    sussFuMo12-Jun-00 15:00 
    GeneralRe: when ondestroy, leaves lines behind Pin
    Rainer Koschnick5-Sep-00 13:34
    sussRainer Koschnick5-Sep-00 13:34 
    General:) Pin
    Alex Turc18-Apr-00 9:31
    sussAlex Turc18-Apr-00 9:31 
    Questionsystem hook???? Pin
    LJP18-Apr-00 6:01
    sussLJP18-Apr-00 6:01 

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

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

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