/*
*********************************************************************
*
*	The Essence of OLE
*
*	Source code sample
*
*	Copyright (c) 1996, Rolling Thunder Computing, Ipswich MA
*
*	e-mail: essence@rollthunder.com
*	CompuServe: 73540,3430
*	Web: http://www.rollthunder.com
*
*	File Name: WINMAIN.CPP
*
*	Purpose: Windows entry point for custom interface client
*
*********************************************************************
*/

#include <windows.h>
#include "resource.h"
#include "elizacl.h"

HINSTANCE hInst ;


int WINAPI WinMain(HINSTANCE  hInstance, HINSTANCE  hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
    MSG msg;
   	WNDCLASS wc ;
	HWND hMainWnd ;   
	HACCEL hAccel ;

	hInst = hInstance ;
/*
Initialize OLE
*/

	CoInitialize (NULL) ;
  /*
  register window classes
  */

    wc.style            = CS_OWNDC;
    wc.lpfnWndProc      = (WNDPROC) MainWndProc;
    wc.cbClsExtra       = 0 ;
    wc.cbWndExtra       = 0 ;
    wc.hInstance        = hInst;
    wc.hIcon            = NULL ;
    wc.hCursor          = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground    = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
    wc.lpszMenuName     = TEXT("MainMenu");
    wc.lpszClassName    = TEXT("PipeclClass");

    if (!RegisterClass(&wc))
        return FALSE;
 

	hAccel = LoadAccelerators (hInst, MAKEINTRESOURCE(IDR_ACCELERATOR1)) ;

    hMainWnd = CreateWindow (TEXT("PipeclClass"), TEXT("IEliza Custom Interface Client"),
            WS_OVERLAPPED | WS_CAPTION | WS_BORDER | WS_THICKFRAME |
            WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_CLIPCHILDREN |
            WS_VISIBLE | WS_SYSMENU,
            CW_USEDEFAULT, CW_USEDEFAULT, 600, 400,
            NULL, NULL, hInst, NULL);

    if (hMainWnd == NULL)
        return FALSE;

  
    while (GetMessage(&msg, NULL, 0, 0)) 
    {
		if (!TranslateAccelerator(hMainWnd, hAccel, &msg))
		{
        	TranslateMessage(&msg);
        	DispatchMessage(&msg);
		}
    }

    return 1;
    
}

