Click here to Skip to main content
15,881,413 members
Articles / Desktop Programming / WTL

Form Designer

26 Jul 2021CPOL24 min read 350.9K   82.5K   230  
Component for adding scriptable forms capabilities to an application.
// PropPageExtended.h : Declaration of the CPropPageExtended
//
// Author : David Shepherd
//			Copyright (c) 2002, DaeDoe-Software
//
/////////////////////////////////////////////////////////////////////////////

#ifndef __PROPPAGEEXTENDED_H_
#define __PROPPAGEEXTENDED_H_

#include "resource.h"       // main symbols

EXTERN_C const CLSID CLSID_PropPageExtended;

/////////////////////////////////////////////////////////////////////////////
// CPropPageExtended
class ATL_NO_VTABLE CPropPageExtended :
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CPropPageExtended, &CLSID_PropPageExtended>,
	public IPropertyPageImpl<CPropPageExtended>,
	public CDialogImpl<CPropPageExtended>
{
private:
// control wrappers
	// name
	CEdit m_ctrlName;

	// returns the form editor window
	CWindow GetFormEditor();

public:
	CPropPageExtended();

	enum {IDD = IDD_PROPPAGEEXTENDED};

DECLARE_REGISTRY_RESOURCEID(IDR_PROPPAGEEXTENDED)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CPropPageExtended)
	COM_INTERFACE_ENTRY(IPropertyPage)
END_COM_MAP()

BEGIN_MSG_MAP(CPropPageExtended)
	CHAIN_MSG_MAP(IPropertyPageImpl<CPropPageExtended>)
	MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
	COMMAND_HANDLER(IDC_NAME, EN_CHANGE, OnChangeName)
END_MSG_MAP()
// Handler prototypes:
//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

// IPropertyPage
	STDMETHOD(Apply)();

// message handlers
	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnChangeName(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
};

#endif //__PROPPAGEEXTENDED_H_

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
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions