/*
*********************************************************************
*
*	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: MAINWIND.CPP
*
*	Purpose: Main MDI frame window for IEliza local server
*
*********************************************************************
*/

#include <windows.h>
#include "pipesv.h"
#include "resource.h"
#include "afxres.h"

HWND hClient ;

extern HINSTANCE hInst ;

LONG CALLBACK MainWndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{

	switch (Msg)
	{
	
		case WM_CREATE :
    	{
			CLIENTCREATESTRUCT clientcreate;
			HMENU  hMenu, hMenuWindow; 			
				
   			hMenu = GetMenu (hWnd) ;
			hMenuWindow = GetSubMenu(hMenu, 1);
 
		    clientcreate.hWindowMenu  = hMenuWindow;
    		clientcreate.idFirstChild = 0x1000;

    		hClient = CreateWindow(TEXT("MDICLIENT"), NULL,
            	WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
                0,0,0,0,
                hWnd, NULL, hInst, (LPVOID)&clientcreate);

			return 0 ;

    	}
    	
		case WM_DESTROY: 
      	{
        	PostQuitMessage(0);
        	return 0L;
      	}


    	default:
		{
           	return DefFrameProc(hWnd,  hClient, Msg, wParam, lParam);
		}
    }
}
