7 _tWinMain(HINSTANCE hThisInstance
,
8 HINSTANCE hPrevInstance
,
12 LPTSTR lpAppName
, lpVersion
, lpTitle
;
18 INITCOMMONCONTROLSEX icex
;
20 hInstance
= hThisInstance
;
21 ProcessHeap
= GetProcessHeap();
23 icex
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
24 icex
.dwICC
= ICC_BAR_CLASSES
| ICC_COOL_CLASSES
;
25 InitCommonControlsEx(&icex
);
27 if (!AllocAndLoadString(&lpAppName
, hInstance
, IDS_APPNAME
) ||
28 !AllocAndLoadString(&lpVersion
, hInstance
, IDS_VERSION
) )
31 _T("Error loading resource "),
37 len
= _tcslen(lpAppName
) + _tcslen(lpVersion
);
38 lpTitle
= (TCHAR
*) HeapAlloc(ProcessHeap
,
40 (len
+ 2) * sizeof(TCHAR
));
47 if (InitMainWindowImpl())
49 if (InitEditWindowImpl())
51 hMainWnd
= CreateMainWindow(lpTitle
,
55 /* pump the message queue */
56 while((bRet
= GetMessage(&Msg
,
63 if (!MainWndTranslateMDISysAccel(hMainWnd
,
66 TranslateMessage(&Msg
);
67 DispatchMessage(&Msg
);
75 UninitEditWindowImpl();
78 UninitMainWindowImpl();
81 LocalFree((HLOCAL
)lpAppName
);