Click here to Skip to main content
15,892,480 members
Articles / Desktop Programming / WTL

Resizable dialogs, form views and property sheets for WTL

Rate me:
Please Sign up or sign in to vote.
4.79/5 (9 votes)
7 Jul 20026 min read 173.5K   2.8K   38  
Implementation of resizable dialogs, form views and property sheets for WTL
// aboutdlg.cpp : implementation of the CAboutDlg class
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resource.h"

#include "aboutdlg.h"

//=============================================================================
// 
//=============================================================================
const UINT CAboutDlg::_controlsToClip[] = 
	{
	IDC_IMG,
	IDOK,
	0
	};

LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	AttachForm(IDOK, ATTACH_RIGHT);
	AttachForm(IDOK, ATTACH_BOTTOM);
	AttachForm(IDC_FRAME, ATTACH_LEFT);
	AttachForm(IDC_FRAME, ATTACH_TOP);
	AttachForm(IDC_FRAME, ATTACH_RIGHT);
	AttachForm(IDC_FRAME, ATTACH_BOTTOM);
	AttachForm(IDC_IMG, ATTACH_HCENTER);
	AttachForm(IDC_IMG, ATTACH_VCENTER);
	AttachForm(IDC_LABEL, ATTACH_HCENTER);
	AttachForm(IDC_LABEL, ATTACH_VCENTER);

	CenterWindow(GetParent());
	return TRUE;
}

LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	EndDialog(wID);
	return 0;
}

//=============================================================================
// 
//=============================================================================
const UINT CAxAboutDlg::_controlsToClip[] = 
	{
	IDC_MSCHART1,
	IDOK,
	0
	};
LRESULT CAxAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	AttachForm(IDOK, ATTACH_RIGHT);
	AttachForm(IDOK, ATTACH_BOTTOM);
	AttachForm(IDC_FRAME, ATTACH_LEFT);
	AttachForm(IDC_FRAME, ATTACH_TOP);
	AttachForm(IDC_FRAME, ATTACH_RIGHT);
	AttachForm(IDC_FRAME, ATTACH_BOTTOM);
	AttachForm(IDC_MSCHART1, ATTACH_LEFT);
	AttachForm(IDC_MSCHART1, ATTACH_TOP);
	AttachForm(IDC_MSCHART1, ATTACH_RIGHT);
	AttachForm(IDC_MSCHART1, ATTACH_BOTTOM);
	AttachForm(IDC_LABEL, ATTACH_HCENTER);
	AttachForm(IDC_LABEL, ATTACH_BOTTOM);

	CenterWindow(GetParent());
	return TRUE;
}

LRESULT CAxAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	EndDialog(wID);
	return 0;
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


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