|
|
Microsoft OS/2 SDK PM 08-08-1988
#include "cardfile.h"
/*********************************************************************/
/* Windows/PM Cardfile Shared Code */
/* */
/* (c) Copyright Microsoft Corp. 1987,1988 - All Rights Reserved */
/*********************************************************************/
/*********************************************************************/
/* The following shared code was developed from the original */
/* Cardfile application. This code can be compiled to run under */
/* either the Windows or the PM manager environment. All */
/* functionality associated with bitmaps or printing has been */
/* deleted. Some comments refering to these functions may still be */
/* present in the code and should be disregarded. jw. */
/*********************************************************************/
/* For PM, this expands into the procedure main which the PM system */
/* calls first. The procedure main calls some initialization */
/* routines and then call WinMain. In Windows, the macro */
/* ENTRYPROCEDURE expands into nothing. */
ENTRYPROCEDURE()
/*********************************************************************/
/* WinMain - */
/* Main routine contain message loop. For PM version, previous */
/* initialization routines have been called at this point. */
/* */
/* Same in Windows and PM. */
/*********************************************************************/
int PASCAL WinMain(hInstance, hPrevInstance, lpszCommandLine, cmdShow)
HINST hInstance, hPrevInstance;
LPSTR lpszCommandLine;
int cmdShow;
{
MSG msg;
/* save instance handle for future use*/
hCardfileInstance = hInstance;
/* In PM, hPrevInstance will always be NULL (see expansion for */
/* ENTRYPROCEDURE in pmbind.h */
/* if first instance of cardfile */
if (!hPrevInstance) {
/* do all one-time initialization */
if (!CardfileInit())
goto InitError;
}
else
/* otherwise get interesting data from previous instance */
GetOldData(hPrevInstance);
/* do per-instance initialization */
if (InitInstance(hInstance, lpszCommandLine, cmdShow)) {
/* message loop */
while (WinGetMsg(hAB,(LPMSG)&msg, NULL, 0, 0))
WinDispatchMsg(hAB, (LPMSG)&msg);
WinDestroyWindow(FRAME(hCardfileWnd));
/* while(TRUE) {
if (GetMessage((LPMSG)&msg, NULL, 0, 0)) {
if (TranslateAccelerator(hCardfileWnd, hAccel,
(LPMSG)&msg) == 0) {
TranslateMessage((LPMSG)&msg);
DispatchMessage((LPMSG)&msg);
}
}
else {
DestroyWindow(FRAME(hCardfileWnd));
break;
}
} */
}
else {
InitError:
MessageBox(NULL, (LPSTR)NotEnoughMem, (LPSTR) NULL,
MB_OK | MB_ICONEXCLAMATION );
}
return(0);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.