Click here to Skip to main content
13,201,940 members (74,857 online)
Click here to Skip to main content
Add your own
alternative version


31 bookmarked
Posted 21 Mar 2003

Loading AVI Resources from Shell32.dll file

, 8 Apr 2003
Rate this:
Please Sign up or sign in to vote.
This program loads AVI animation clips from shell32.dll file and minimizes the executable file size (like for SFX).

Sample Image - AVI_Animation.jpg


This is a simple Win32 API project which will load the AVI clips directly from the Shell32.dll file and you can minimize the file size, so that you will not have to include the animations like file copy or file move into your SFX.

I am a fan of building small sized, standalone exes which have minimum dependencies and don't need the setup programs. I hope this article will help those who want to minimize application size.

Here I have used the CreateWindowEx API function to create the animation control and to add it dynamically to the main dialog window.


The global variables

//Handle and Instance
HWND AnimationCtrl;
HINSTANCE gInstance,avi;

Now just create the main dialog procedure and control and the program is ready for you. Here we are setting the instance of animation control to shell32.dll and so we will do not have to load the AVI form file. Just access the resources as regular example: 161,162 etc...

//Main Dialog procedure
BOOL CALLBACK MainDlgProc(HWND hDlg, UINT message, 
                          WPARAM wParam, LPARAM lParam)



        //Creates the animation control
            MessageBox(hDlg,"Unable to load library.","ANI",0);
            //Library loaded now create the animation control
            AnimationCtrl=CreateWindowEx(0,  //Style   
                        ANIMATE_CLASS,             //Class Name   
                        NULL,                      //Window name   
                        WS_CHILD|WS_VISIBLE|       //Window Style   
                        0,                         //Left   
                        0,                         //Top   
                        300,                       //Right   
                        60,                        //Bottom   
                        hDlg,                      //Handle of parent   
                        NULL,                      //Menu   
                        avi,                       //hInstance
                        NULL);                     //User defined style   

            //Control created Now open the avi resource
                MessageBox(hDlg,"Cannot Load the avi resource","ANI",0);




    return 0;


And the WinMain

//Main WIndow
int WINAPI WinMain(HINSTANCE hInstance,
      HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
    return 0;


In this way, with a small code you can access the AVI resources form the shell32.dll file or any DLL. Just change the LoadLibrary() function.

If you really like this article then mail me your comments at: and if you are interested in using small size Win32 applications then visit my website which is being created. The SuperSplit application is based on this code, has a too much small size (less than few KB!) and good functionality and is a good example of using this control; you may download it form my home page.

Distribute this code freely but not for any profit. I am waiting for your reply...


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

Yogesh M Joshi
Software Developer AVAYA India Pvt Ltd.
India India
I have completed my B.E. Degree in IT form Aditya Engineering College, Beed. (Maharashtra) India.

I have completed Diploma In Advanced Computing (DAC) in Feb 07.

Now I am working for AVAYA India Pvt. LTD as software engineer.
Platform : C/C++, Solaris 10, AIX and Windows

You may also be interested in...


Comments and Discussions

QuestionHow do you figure out the resource ID for the animation? Pin
ARB706-Jul-06 1:35
memberARB706-Jul-06 1:35 
AnswerRe: How do you figure out the resource ID for the animation? Pin
ARB706-Jul-06 6:18
memberARB706-Jul-06 6:18 
AnswerRe: How do you figure out the resource ID for the animation? Pin
ryltsov5-Apr-07 8:32
memberryltsov5-Apr-07 8:32 
Questionhow can i use it in c#? Pin
jabulino9-Jan-06 5:44
memberjabulino9-Jan-06 5:44 
AnswerRe: how can i use it in c#? Pin
Yogesh M Joshi.22-Jan-06 21:36
memberYogesh M Joshi.22-Jan-06 21:36 
GeneralRe: how can i use it in c#? Pin
jabulino22-Jan-06 21:42
memberjabulino22-Jan-06 21:42 
GeneralToo much code Pin
WebFritzi26-Jan-04 13:16
memberWebFritzi26-Jan-04 13:16 
GeneralReformat... Pin
Kant22-Mar-03 4:32
memberKant22-Mar-03 4:32 
GeneralRe: Reformat... Pin
Yogesh M Joshi.23-Mar-03 1:13
memberYogesh M Joshi.23-Mar-03 1:13 
Thanks for your suggestion I have reformatted the article please view it.

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171020.1 | Last Updated 9 Apr 2003
Article Copyright 2003 by Yogesh M Joshi
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid