Click here to Skip to main content
15,881,715 members
Articles / Web Development / HTML

A Comprehensive CE Class Library to Replace ATL and MFC

Rate me:
Please Sign up or sign in to vote.
4.48/5 (14 votes)
4 Oct 2000CPOL 278K   998   70  
A collection of classes for CE that do not use ATL or MFC, plus an FTP client, database viewer, and sample application that solves beam deflection equations.
// Setup.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "DbViewRes.h"

int CreateWizard(HWND hwndOwner);

static BOOL InitApplication(HINSTANCE hInstance);
static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow);
static void FillInPropertyPage(PROPSHEETPAGE* pPSP, int nDlg, LPTSTR pszProc, DLGPROC pfnDlgProc);
static BOOL APIENTRY PP1Proc(HWND hDlg, UINT message, UINT wParam, LONG lParam);
static BOOL APIENTRY PP2Proc(HWND hDlg, UINT message, UINT wParam, LONG lParam);
static LONG APIENTRY MainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam);

//CreateWizard(NULL, hInstance);


//
//
//  FUNCTION: FillInPropertyPage(PROPSHEETPAGE *, int, LPSTR, LPFN) 
//
//  PURPOSE: Fills in the given PROPSHEETPAGE structure 
//
//  COMMENTS:
//
//      This function fills in a PROPSHEETPAGE structure with the
//      information the system needs to create the page.
// 
void FillInPropertyPage(PROPSHEETPAGE* pPSP, int nDlg, LPTSTR pszProc, DLGPROC pfnDlgProc)
{
	pPSP->dwSize		= sizeof(PROPSHEETPAGE);
	pPSP->dwFlags		= 0;
	pPSP->hInstance		= CeGetAppInstance();
	pPSP->pszTemplate	= MAKEINTRESOURCE(nDlg);
	pPSP->pszIcon		= NULL;
	pPSP->pfnDlgProc	= pfnDlgProc;
	pPSP->pszTitle		= pszProc;
	pPSP->lParam		= 0;
}



//
//
//    FUNCTION: CreateWizard(HWND)
//
//    PURPOSE: Create the Wizard control. 
//
//   COMMENTS:
//	
//      This function creates the wizard property sheet.
//
int CreateWizard(HWND hwndOwner)
{
    PROPSHEETPAGE psp[2];
    PROPSHEETHEADER psh;

	FillInPropertyPage( &psp[0], IDD_PROPPAGE_1, TEXT("I"), PP1Proc);
	FillInPropertyPage( &psp[1], IDD_PROPPAGE_2, TEXT("II"), PP2Proc);

	psh.hInstance = CeGetAppInstance();
    psh.dwSize = sizeof(PROPSHEETHEADER);
    psh.dwFlags = PSH_PROPSHEETPAGE | PSH_WIZARD | PSH_NOAPPLYNOW;
    psh.hwndParent = hwndOwner;
    psh.pszCaption = (LPTSTR) TEXT("Setup Wizard");
    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
    psh.nStartPage = 0;
    psh.ppsp = (LPCPROPSHEETPAGE) &psp;

    return (PropertySheet(&psh));
}


//
//  FUNCTION: PP1Proc(HWND, UINT, UINT, LONG)
//
//  PURPOSE:  Processes messages for "Addaptability to Change" page 
//
//  MESSAGES:
//	
//	WM_INITDIALOG - intializes the page
//	WM_NOTIFY - processes the notifications sent to the page
//	WM_COMMAND - saves the id of the choice selected
//
//
BOOL APIENTRY PP1Proc(HWND hDlg, UINT message, UINT wParam, LONG lParam)
{
	switch (message)
	{
	case WM_INITDIALOG:
		break;
		
	case WM_COMMAND:
		break;				
		
	case WM_NOTIFY:
		switch (((NMHDR FAR *) lParam)->code) 
		{
		case PSN_KILLACTIVE:
			SetWindowLong(hDlg,	DWL_MSGRESULT, FALSE);
			break;

		case PSN_RESET:
			SetWindowLong(hDlg,	DWL_MSGRESULT, FALSE);
			break;

		case PSN_SETACTIVE:
			PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_NEXT);
			break;

		case PSN_WIZBACK:
			break;

		case PSN_WIZFINISH:
			break;
			
		default:
			return FALSE;
		}
		break;
		
		default:
			return FALSE;
	}

	return TRUE;   
}


//
//  FUNCTION: PP2Proc(HWND, UINT, UINT, LONG)
//
//  PURPOSE:  Processes messages for "Addaptability to Change" page 
//
//  MESSAGES:
//	
//	WM_INITDIALOG - intializes the page
//	WM_NOTIFY - processes the notifications sent to the page
//	WM_COMMAND - saves the id of the choice selected
//
//
BOOL APIENTRY PP2Proc(HWND hDlg, UINT message, UINT wParam, LONG lParam)
{
	switch (message)
	{
	case WM_INITDIALOG:
		break;
		
	case WM_COMMAND:
		break;				
		
	case WM_NOTIFY:
		switch (((NMHDR FAR *) lParam)->code) 
		{
		case PSN_KILLACTIVE:
			SetWindowLong(hDlg,	DWL_MSGRESULT, FALSE);
			return 1;

		case PSN_RESET:
			// rest to the original values
			SetWindowLong(hDlg,	DWL_MSGRESULT, FALSE);
			break;

		case PSN_SETACTIVE:
			PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_BACK | PSWIZB_FINISH);
			break;

		case PSN_WIZBACK:
			break;

		case PSN_WIZFINISH:
			break;
			
		default:
			return FALSE;
		}
		break;
		
		default:
			return FALSE;
	}

	return TRUE;   
}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions