helpdlg.cpp

来自「通讯录管理系统1.0 可以为您方便地, 安全地管理你的通讯录, 是您的家庭好帮」· C++ 代码 · 共 93 行

CPP
93
字号
// HelpDlg.cpp : implementation file
//

#include "stdafx.h"
#include "SGAdrLstMS.h"
#include "HelpDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHelpDlg dialog


CHelpDlg::CHelpDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CHelpDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CHelpDlg)
	m_hlptxt = _T("");
	//}}AFX_DATA_INIT
}


void CHelpDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CHelpDlg)
	DDX_Text(pDX, IDC_HLPTXT, m_hlptxt);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CHelpDlg, CDialog)
	//{{AFX_MSG_MAP(CHelpDlg)
	ON_BN_CLICKED(IDC_SHOUTDOWN, OnShoutdown)
	ON_WM_SHOWWINDOW()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHelpDlg message handlers

BOOL CHelpDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	

	char cs[256];
	
	//GetModuleFileName(NULL,cs,256);
	::GetCurrentDirectory(256,cs);

	
	
	strcat(cs,"\\SGAdrLstMSHlp.txt");

	CFile hlp;
	if (!hlp.Open(cs,0))
	{
		MessageBox("找不到帮助主题文件","错误",MB_ICONSTOP);
		return FALSE;
	}
	

	char  txt[10000]="";
	
	hlp.Read(txt,hlp.GetLength());
	this->UpdateData(true);
	this->m_hlptxt = txt;
	this->UpdateData(false);

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CHelpDlg::OnShoutdown() 
{

	
	this->OnOK();
}

void CHelpDlg::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
    this->GetDlgItem(IDC_SHOUTDOWN)->SetFocus();	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?