The Animate command on the Viewer menu actually creates a new instance of Viewer and loads a new copy of the title in the new instance. This part of MENUDEMO resembles the part that displays a given topic, but there is a noticeable difference in the usCommand parameter, as shown in the following code fragment:
case IDM_MVANIM:
CheckLoadUsa(hwnd) ;
lstrcpy(Topic,"az_population");
wsprintf(str, (LPSTR)JITemplate, (LPSTR)BookPath,
(LPSTR)Topic);
MVAPI(hwnd, BookPath, cmdMacro | cmdNewInstance,
(DWORD)(LPSTR)str);
return 0 ;
Here, the constants cmdMacro and cmdNewInstance are binary-ORed to indicate that the Viewer command should be carried out after MVAPI creates a new instance of Viewer.