/*
*********************************************************************
*
*	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: TIMETEST.CPP
*
*	Purpose: Dialog box response function for custom interface client
*
*********************************************************************
*/

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

extern UINT nReps ;
extern BOOL bUseEliza ;

BOOL CALLBACK TimeTestDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg)
	{
		case WM_INITDIALOG:
		{
			SetDlgItemInt (hDlg, IDC_EDIT1, nReps, FALSE) ;
			CheckDlgButton (hDlg, IDC_CHECK1, bUseEliza) ; 
		}
		case WM_COMMAND:
		{
			if (LOWORD(wParam) == IDOK)
			{
				nReps = GetDlgItemInt (hDlg, IDC_EDIT1, NULL, FALSE) ;
				bUseEliza = IsDlgButtonChecked (hDlg, IDC_CHECK1) ;
				EndDialog (hDlg, IDOK) ;
			}
			else if (LOWORD(wParam) == IDCANCEL)
			{
				EndDialog (hDlg, IDCANCEL) ;
			}

			return FALSE ;
		}
	}
	return FALSE ;
}