📄 dialogautosave.cpp
字号:
// DialogAutoSave.cpp : implementation file
//
#include "stdafx.h"
#include "IE6mdi.h"
#include "DialogAutoSave.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogAutoSave dialog
CDialogAutoSave::CDialogAutoSave(CWnd* pParent /*=NULL*/)
: CDialog(CDialogAutoSave::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialogAutoSave)
m_filename = _T("");
m_delay = 0;
//}}AFX_DATA_INIT
}
void CDialogAutoSave::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogAutoSave)
DDX_Text(pDX, IDC_FILENAME, m_filename);
DDX_Text(pDX, IDC_DELAY, m_delay);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogAutoSave, CDialog)
//{{AFX_MSG_MAP(CDialogAutoSave)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogAutoSave message handlers
/*
*******************************************************************************/
// FUNCTION : void CDialogAutoSave::OnBrowse()
//
// PURPOSE :
//
// PARAMETERS : none
//
// RETURN VALUE : void
//
//
// COMMENTS :
//
//
/*******************************************************************************
*/
void CDialogAutoSave::OnBrowse()
{
CWinApp* pApp = AfxGetApp();
CFileDialog dlg(FALSE, "LHTM files","*.lhtm",
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,(CString(LPCTSTR(IDS_LISTETYPE))));
// set the default directory
OPENFILENAME op = dlg.m_ofn;
op.lpstrInitialDir = pApp->GetProfileString("Settings","LHTM default path",NULL);
dlg.m_ofn = op;
if (dlg.DoModal() == IDOK) {
CFile file;
// we will create an HTM file containing the links to these URL's
if (!file.Open(dlg.GetPathName(), CFile::modeCreate | CFile::modeWrite))
{
// an error occured
AfxMessageBox(CString(LPCTSTR(IDS_FILEERROR)));
return;
}
////////////////////////////////////
// Save the current directory
////////////////////////////////////
CString pn = dlg.GetPathName();
CString fn = dlg.GetFileName();
pn = pn.Left(pn.GetLength()-fn.GetLength());
pApp->WriteProfileString("Settings","LHTM default path",pn);
file.Close();
UpdateData(TRUE);
m_filename = dlg.GetPathName();
UpdateData(FALSE);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -