Reusable AVI Resources

While fixing Vista compatibility problems, an interesting issue arose with AVI clips. It is widely known that Windows shell animations are small AVI clips linked into shell32.dll binary as a resource of type “AVI”. Other DLLs have their clips too and standard animation common control is capable of picking the clips.

It is quite convenient to reuse shell32.dll animations in an action progress UI:

image001.png

However, it appeared that Vista’s shell32.dll comes with no more AVI clip at #170 resource in shell32.dll. So I needed a replacement and finally I made an application I have been needed since long ago: a batch grabber for AVI resources to see what AVIs come with clean OS.

The application takes binary file name (dll or exe) on the input and format for AVI clip file name to be exported (default is “$(ModuleName)-$(Name)-$(Language).avi”) and found AVIs are exported from the binary into separate files. A batch file with a command

for %%i in (%windir%\system32\*.dll) do ExportAviResources “%%i”

exports all AVIs from all DLLs lying in Windows system directory. There are nice ones there, it’s worth a look.


ieakui-#201-0409.avi
ieframe-#1-0409.avi
ieframe-#2-0409.avi
iepeers-#204-0409.avi
msieftp-#257-0409.avi
NetProjW-#201-0409.avi
printui-#430-0409.avi
printui-#435-0409.avi
setupapi-#61-0409.avi
shell32-#151-0409.avi
shell32-#160-0409.avi
shell32-#162-0409.avi
shell32-#164-0409.avi
shell32-#166-0409.avi
shell32-#168-0409.avi
srchadmin-#1301-0409.avi
syncui-#134-0409.avi
wiadefui-#1000-0409.avi

shell32-#166-0409.avi means that shell32.dll has an AVI resource number 166 in English language (0×0409).

The easiest way to use this AVI in an animation control is (this assumes shell32.dll is already loaded into the process):

Animate_OpenEx(m_Animate, GetModuleHandle(_T(“shell32.dll”)), MAKEINTRESOURCE(166));

Partial (some header files are excluded, however the basic idea is clear) Visual C++.NET 2005 source code can be downloaded here, compiled binary – here.

See also: Common Controls – New in Windows Vistaâ„¢

Leave a Reply