Предыдущая Следующая
8. Загрузка акселераторов, создание и отображение окна фрейма, реализация цикла обработки сообщений. Некоторые варианты этого кода являются общими для всех приложений windows независимо от того, приложение ли это UWL или нет.
9. Приборка после завершения работы. Удаление фрейма и объектов управления MDI, освобождение связанного списка типов дочерних окон. В приложениях Windows важно освободить память, поскольку распределяемая под объекты память может быть вне границ приложения.
280
Фракталы и вейвлеты для сжатия изображений в действии
Листинг В.2.6. Функиия WinMain лая системы IMG. Шаги, которые выполняются
функиии WinMain лля типичного приложения UWL, выделены
// IMGMAIN. СРР WinMain for IMG system: Fractal image // compression.
#include <stdlib.h>
#include "uwl.h" #include "imgwin.h" #include "decwin.h" #include "encwin.h" #include "soencwin.h" #include "subwin.h" #include "plt2dwin.h"
// For menu position constants: #include "mdifmids.h" #include "imgrids.h"
// Step 1: Define Windows class names for the frame // and each type of child window.
char szFrameClass [] = "IMGFrame" ;
char szIMGSClass [] = "IMGChild";
char IMG_title [] = "IMG Window";
char szDECSClass [] = "DECChild";
char DEC_title [] = "DEC Window";
char szSUBSClass [] = "SUBChild";
char SUB__title [] = "SUB Window";
char szPLOTSClass [] = "PLOTChild";
char PLOT_title [] = "PLOT Window";
char szSELFORGSClass [] = "SELFORGChild";
char SELF_ORG_title [] = "SELF ORG Window";
HINSTANCE hlnst ;
int WINAPI WinMain (HINSTANCE hlnstance,
HINSTANCE hPrevInstance, LPSTR, int nCmdShow)
{
HACCEL hAccel ;
HWND hwndFrame, hwndClient ;
_MSG_msg ;_ _
// Step 2: Define the linked list for the MDI child // window types._
tmdi_type_list_struct *child_list, *child_type ;
// Step 3: Define an object for the frame window, and an object // for the MPI manager for each child window type.___ Предыдущая Следующая
|