#pragma	title("Simple Example  --  Version 1.0  --  (Example.C)")
#pragma	subtitle("   Main Module - Interface Definitions")

#define	INCL_DOS		   /* Include OS/2 DOS Kernal		*/
#define	INCL_WIN		   /* Include OS/2 PM Windows Interface	*/

#if defined(__IBMC__)

#pragma	info(nopar)

#endif

#include <os2.h>

#include "appdefs.h"
#include "example.h"

/* This	module contains	routine	used to	handle the main	entry point to	*/
/* the application.							*/

/* Filename:   Example.C						*/

/*  Version:   1.0							*/
/*  Created:   1994-08-22						*/
/*  Revised:   1994-08-22						*/

/* Routines:   INT main(INT argc, CHAR *argv[ ]);			*/


/* Copyright ¸ 1994  Prominare Inc.  All Rights	Reserved.		*/

/* --------------------------------------------------------------------	*/

/************************************************************************/
/************************************************************************/
/*		       DISCLAIMER OF WARRANTIES.			*/
/************************************************************************/
/************************************************************************/
/*     The following [enclosed]	code is	library	code created by		*/
/*     Prominare Inc.  This library code is  provided to you solely	*/
/*     for the purpose of assisting you	in the development of your	*/
/*     applications.  The code is provided "AS IS", without		*/
/*     warranty	of any kind.  Prominare	Inc. shall not be liable	*/
/*     for any damages arising out of your use of the library code,	*/
/*     even if they have been advised of the possibility of such	*/
/*     damages.								*/
/************************************************************************/
/************************************************************************/

PSZ pszExampleClassName	= "Example";

INT main(INT argc, CHAR	*argv[ ])

{
QMSG  qmsg;			   /* PM Message Queue Holder		*/

		       /* Initialize the program for PM	and create the	*/
		       /* message queue					*/
hAB = WinInitialize(0);
hmqExample = WinCreateMsgQueue(hAB, 0);

		       /* Register the window class			*/

if ( !WinRegisterClass(hAB, pszExampleClassName, (PFNWP)ExampleWndProc,
		       CS_SYNCPAINT | CS_SIZEREDRAW, 0)	)
   return(0);
		       /* Create the main program window		*/

if ( !(hwndExampleFrame	= CreateStdWindow(HWND_DESKTOP,	WS_VISIBLE,
					  FCF_NOBYTEALIGN | FCF_SHELLPOSITION |	
					  FCF_TITLEBAR | FCF_ICON | FCF_SYSMENU	|
					  FCF_MENU | FCF_MINMAX	|
					  FCF_ACCELTABLE | FCF_SIZEBORDER,
					  pszExampleClassName, "Example Window", 0L,
					  (HMODULE)NULL, ID_WINDOW, &hwndExample, 10, 23, 337, 196)) )
   return(0);

InitApp(hwndExampleFrame, hwndExample, "Example Window");

		       /* Get and dispatch the message to program	*/
		       /* windows					*/

while (	WinGetMsg(hAB, &qmsg, (HWND)NULL, 0, 0)	)
   WinDispatchMsg(hAB, &qmsg);

		       /* Have received	a WM_QUIT, start the program	*/
		       /* shutdown by destroying the program windows	*/
		       /* and destroying the message queue		*/

WinDestroyWindow(hwndExampleFrame);
WinDestroyMsgQueue(hmqExample);

		       /* Notify PM that main program thread not needed	*/
		       /* any longer					*/
WinTerminate(hAB);
		       /* Exit back to OS/2 cleanly			*/
return(0);
}
