File:  [OS/2 SDKs] / pmsdk / samples / newcard / cfres.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:28:12 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: pmsdk-1988, HEAD
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);
}


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.