|
|
1.1 ! root 1: #include "cardfile.h" ! 2: ! 3: ! 4: /*********************************************************************/ ! 5: /* Windows/PM Cardfile Shared Code */ ! 6: /* */ ! 7: /* (c) Copyright Microsoft Corp. 1987,1988 - All Rights Reserved */ ! 8: /*********************************************************************/ ! 9: ! 10: /*********************************************************************/ ! 11: /* The following shared code was developed from the original */ ! 12: /* Cardfile application. This code can be compiled to run under */ ! 13: /* either the Windows or the PM manager environment. All */ ! 14: /* functionality associated with bitmaps or printing has been */ ! 15: /* deleted. Some comments refering to these functions may still be */ ! 16: /* present in the code and should be disregarded. jw. */ ! 17: /*********************************************************************/ ! 18: ! 19: ! 20: /* For PM, this expands into the procedure main which the PM system */ ! 21: /* calls first. The procedure main calls some initialization */ ! 22: /* routines and then call WinMain. In Windows, the macro */ ! 23: /* ENTRYPROCEDURE expands into nothing. */ ! 24: ! 25: ! 26: ENTRYPROCEDURE() ! 27: ! 28: ! 29: /*********************************************************************/ ! 30: /* WinMain - */ ! 31: /* Main routine contain message loop. For PM version, previous */ ! 32: /* initialization routines have been called at this point. */ ! 33: /* */ ! 34: /* Same in Windows and PM. */ ! 35: /*********************************************************************/ ! 36: ! 37: int PASCAL WinMain(hInstance, hPrevInstance, lpszCommandLine, cmdShow) ! 38: HINST hInstance, hPrevInstance; ! 39: LPSTR lpszCommandLine; ! 40: int cmdShow; ! 41: { ! 42: MSG msg; ! 43: ! 44: /* save instance handle for future use*/ ! 45: hCardfileInstance = hInstance; ! 46: ! 47: /* In PM, hPrevInstance will always be NULL (see expansion for */ ! 48: /* ENTRYPROCEDURE in pmbind.h */ ! 49: ! 50: /* if first instance of cardfile */ ! 51: if (!hPrevInstance) { ! 52: /* do all one-time initialization */ ! 53: if (!CardfileInit()) ! 54: goto InitError; ! 55: } ! 56: else ! 57: /* otherwise get interesting data from previous instance */ ! 58: GetOldData(hPrevInstance); ! 59: ! 60: /* do per-instance initialization */ ! 61: if (InitInstance(hInstance, lpszCommandLine, cmdShow)) { ! 62: /* message loop */ ! 63: ! 64: while (WinGetMsg(hAB,(LPMSG)&msg, NULL, 0, 0)) ! 65: WinDispatchMsg(hAB, (LPMSG)&msg); ! 66: WinDestroyWindow(FRAME(hCardfileWnd)); ! 67: ! 68: ! 69: /* while(TRUE) { ! 70: if (GetMessage((LPMSG)&msg, NULL, 0, 0)) { ! 71: if (TranslateAccelerator(hCardfileWnd, hAccel, ! 72: (LPMSG)&msg) == 0) { ! 73: TranslateMessage((LPMSG)&msg); ! 74: DispatchMessage((LPMSG)&msg); ! 75: } ! 76: } ! 77: else { ! 78: DestroyWindow(FRAME(hCardfileWnd)); ! 79: break; ! 80: } ! 81: } */ ! 82: } ! 83: else { ! 84: InitError: ! 85: MessageBox(NULL, (LPSTR)NotEnoughMem, (LPSTR) NULL, ! 86: MB_OK | MB_ICONEXCLAMATION ); ! 87: } ! 88: ! 89: return(0); ! 90: } ! 91:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.