www.pudn.com > zcColor.rar > TBColor.cpp, change:2001-07-27,size:1860b


//////////////////////////////////////////////////////////////// 
// VCDKBASE Online Journal -- July 2001 
// Compiles with Visual C++ 6.0. Runs on Win 98 and probably Win 2000 too. 
// Set tabsize = 3 in your editor. 
// 
#include "StdAfx.h" 
#include "MainFrm.h" 
#include "Doc.h" 
#include "View.h" 
#include "StatLink.h" 
#include "Resource.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
class CMyApp : public CWinApp { 
public: 
	CMyApp(); 
	virtual BOOL InitInstance(); 
protected: 
	afx_msg void OnAppAbout(); 
	DECLARE_MESSAGE_MAP() 
} theApp; 
 
BEGIN_MESSAGE_MAP(CMyApp, CWinApp) 
	ON_COMMAND(ID_APP_ABOUT, OnAppAbout) 
END_MESSAGE_MAP() 
 
CMyApp::CMyApp() 
{ 
} 
 
BOOL CMyApp::InitInstance() 
{ 
	CMainFrame* pFrame = new CMainFrame; 
	m_pMainWnd = pFrame; 
	pFrame->LoadFrame(IDR_MAINFRAME, 
		WS_OVERLAPPEDWINDOW, NULL, 
		NULL); 
	pFrame->ShowWindow(SW_SHOW); 
	pFrame->UpdateWindow(); 
 
	return TRUE; 
} 
 
////////////////// 
// Custom about dialog uses CStaticLink for hyperlinks. 
// URL is specified as string resource or static text 
// 
class CAboutDialog : public CDialog { 
protected: 
	// static controls with hyperlinks 
	CStaticLink	m_wndLink1; 
	CStaticLink	m_wndLink2; 
	CStaticLink	m_wndLink3; 
 
public: 
	CAboutDialog() : CDialog(IDD_ABOUTBOX) { } 
	virtual BOOL OnInitDialog(); 
}; 
 
///////////////// 
// Initialize dialog: subclass static text/icon controls 
// 
BOOL CAboutDialog::OnInitDialog() 
{ 
	// subclass static controls. URL is static text or 3rd arg 
	m_wndLink1.SubclassDlgItem(IDC_PDURL,this); 
	m_wndLink2.SubclassDlgItem(IDC_VCKBASEURL,this); 
	m_wndLink3.SubclassDlgItem(IDC_VCKBASELOGO,this); 
	return CDialog::OnInitDialog(); 
} 
 
////////////////// 
// Run the About dialog 
// 
void CMyApp::OnAppAbout() 
{ 
	CAboutDialog().DoModal(); 
}