Click here to Skip to main content
15,881,559 members
Articles / Desktop Programming / MFC

The Ultimate TCP/IP Home Page

Rate me:
Please Sign up or sign in to vote.
4.98/5 (77 votes)
25 Aug 2007CPOL13 min read 2.5M   45.4K   267  
Ultimate TCP-IP is now Open Source
// =================================================================
//  class: CAboutDlg
//  File:  AboutDlg.h
//  
//  Purpose:
//
//	Display Mail ActiveX Control about box
//
// =================================================================
// Ultimate TCP/IP v4.2
// This software along with its related components, documentation and files ("The Libraries")
// is � 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
// governed by a software license agreement ("Agreement").  Copies of the Agreement are
// available at The Code Project (www.codeproject.com), as part of the package you downloaded
// to obtain this file, or directly from our office.  For a copy of the license governing
// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
// =================================================================
#ifndef __ABOUTDLG_H_
#define __ABOUTDLG_H_

#include "resource.h"       // main symbols
#include <atlhost.h>

// Suppress warnings for non-safe str fns. Transitional, for VC6 support.
#pragma warning (push)
#pragma warning (disable : 4996)

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg
class CAboutDlg : 
	public CAxDialogImpl<CAboutDlg>
{
private:
	LPCSTR	lpszMessage;	// Pointer to the additional message

public:
	CAboutDlg(LPCSTR message = NULL) : lpszMessage(message)
	{
	}

	~CAboutDlg()
	{
	}

	enum { IDD = IDD_ABOUTDLG };

BEGIN_MSG_MAP(CAboutDlg)
	MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
	COMMAND_ID_HANDLER(IDOK, OnOK)
	COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
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);

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{

		#ifdef EVALUATION_MODE

			// Change about box text in case of evaluation mode
			char	szVersionText[50], szEvaluationVersionText[50];
			GetDlgItemText(IDC_VERSION_TEXT, szVersionText, sizeof(szVersionText) - 1);
			
			strcpy(szEvaluationVersionText, "Evaluation ");
			strcat(szEvaluationVersionText, szVersionText);
			strcat(szEvaluationVersionText, " Not for commercial use!");

			SetDlgItemText(IDC_VERSION_TEXT, szEvaluationVersionText);

		#endif

        #ifdef _BLOCKING_MODE_ONLY
			// Change about box text in case of blocking mode only
			char	szVersionText[50], szEvaluationVersionText[50];
			GetDlgItemText(IDC_VERSION_TEXT, szVersionText, sizeof(szVersionText) - 1);
			
			strcpy(szEvaluationVersionText, szVersionText);
			strcat(szEvaluationVersionText, " (Blocking Mode Only)");

			SetDlgItemText(IDC_VERSION_TEXT, szEvaluationVersionText);
        #endif


		// Set additional message in the version number field
		if(lpszMessage)
			SetDlgItemText(IDC_VERSION_TEXT, lpszMessage);

		return 1;  // Let the system set the focus
	}

	LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
	{
		EndDialog(wID);
		return 0;
	}

	LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
	{
		EndDialog(wID);
		return 0;
	}
};

#pragma warning(pop)

#endif //__ABOUTDLG_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
Canada Canada
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
This is a Organisation

476 members

Comments and Discussions