📄 myimgapp.cpp
字号:
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Myimgapp.h"
#include "about.h"
#include "MainFrm.h"
#include "Doc.h"
#include "View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyApp
BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
//{{AFX_MSG_MAP(CMyApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_AA, OnAa)
ON_COMMAND(ID_BB, OnBb)
ON_COMMAND(ID_CC, OnCc)
ON_COMMAND(ID_DD, OnDd)
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyApp construction
CMyApp::CMyApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMyApp object
CMyApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMyApp initialization
BOOL CMyApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
AfxInitRichEdit();
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(0); // Load standard INI file options (including MRU)
CString str ;
str = GetPath() ;
m_strIni = str + _T("..\\help\\language\\");
//Get the language ini file
if(0x0804 == GetSystemDefaultLangID()) //Chinese Simplified
m_strIni += _T("chs.txt");
else
m_strIni += _T("eng.txt"); //English
//The default URF
str += _T("fyqone.urf");
//Load the default powerful URF
if(!SKINSTART((LPTSTR)(LPCTSTR)str,WINDOW_TYPE_VC,_T(""),GTP_LOAD_FILE,NULL,NULL)) //Load a powerful urf skin from file firstly
{
//Load a basic URF skin if failed (expired may be)
str = ReadUIText(4) ;
AfxMessageBox(str) ;
str = GetDemoURFPath() ;
SKINSTART((LPTSTR)(LPCTSTR)str,WINDOW_TYPE_VC,_T(""),GTP_LOAD_FILE,NULL,NULL) ;
}
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CPictureDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CPictureView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
CString CMyApp::ReadUIText( int nIndex )
{
CString strReturn;
CString str ;
str.Format(_T("%d"),nIndex) ;
GetPrivateProfileString(_T("TEXT"),
str,
_T(""),
strReturn.GetBufferSetLength(256),
256,
m_strIni);
strReturn.ReleaseBuffer();
return strReturn;
}
/////////////////////////////////////////////////////////////////////////////
// CAUDKApp message handlers
int CMyApp::ExitInstance()
{
// TODO: Add your specialized code here and/or call the base class
SkinRemove();
return CWinApp::ExitInstance();
}
CString CMyApp::GetPath()
{
CString str = this->m_pszHelpFilePath ;
str = str.Left(str.ReverseFind(_T('\\'))+1) ;
return str ;
}
CString CMyApp::GetDemoURFPath()
{
CString str = GetPath() ;
str += _T("sap_af.urf");
return str ;
}
// App command to run the About dialog
void CMyApp::OnAppAbout()
{
CAboutDlg().DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CMyApp message handlers
void CMyApp::OnAa()
{
// TODO: Add your command handler code here
CString str = GetPath();
str += _T("macosx.urf");
SKINSTART((LPTSTR)(LPCTSTR)str,WINDOW_TYPE_VC,_T(""),GTP_LOAD_FILE,NULL,NULL);
}
void CMyApp::OnBb()
{
// TODO: Add your command handler code here
CString str = GetPath();
str += _T("pixos.urf");
SKINSTART((LPTSTR)(LPCTSTR)str,WINDOW_TYPE_VC,_T(""),GTP_LOAD_FILE,NULL,NULL) ;
}
void CMyApp::OnCc()
{
// TODO: Add your command handler code here
CString str = GetPath();
str += _T("onion.urf");
SKINSTART((LPTSTR)(LPCTSTR)str,WINDOW_TYPE_VC,_T(""),GTP_LOAD_FILE,NULL,NULL);
}
void CMyApp::OnDd()
{
// TODO: Add your command handler code here
CString str = GetPath();
str += _T("fyqone.urf");
SKINSTART((LPTSTR)(LPCTSTR)str,WINDOW_TYPE_VC,_T(""),GTP_LOAD_FILE,NULL,NULL);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -