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:
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.
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));
See also: Common Controls – New in Windows Vista™