📄 openfile.cpp
字号:
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include "StdAfx.h"
#include "resource.h"
#include "GConsole.h"
#include "Engine.h"
#include "OpenFile.h"
TCHAR szFileName[256];
TCHAR szTitleName[256];
static TCHAR szFilter[] = TEXT ("BIN Files (*.bin;*.prg;*.dat)\0*.bin;*.prg;*.dat\0") \
TEXT ("All Files (*.*)\0*.*\0\0") ;
static OPENFILENAME ofn ;
void PopFileInitialize (HWND hwnd)
{
ofn.lStructSize = sizeof (OPENFILENAME) ;
ofn.hwndOwner = hwnd ;
ofn.hInstance = NULL ;
ofn.lpstrFilter = szFilter;
ofn.lpstrCustomFilter = NULL ;
ofn.nMaxCustFilter = 0 ;
ofn.nFilterIndex = 0 ;
ofn.lpstrFile = NULL ; // Set in Open and Close functions
ofn.nMaxFile = MAX_PATH ;
ofn.lpstrFileTitle = NULL ; // Set in Open and Close functions
ofn.nMaxFileTitle = MAX_PATH ;
ofn.lpstrInitialDir = NULL ;
ofn.lpstrTitle = NULL ;
ofn.Flags = 0 ; // Set in Open and Close functions
ofn.nFileOffset = 0 ;
ofn.nFileExtension = 0 ;
ofn.lpstrDefExt = TEXT ("bin") ;
ofn.lCustData = 0L ;
ofn.lpfnHook = NULL ;
ofn.lpTemplateName = NULL ;
}
BOOL PopFileOpenDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName)
{
ofn.hwndOwner = hwnd ;
ofn.lpstrFile = pstrFileName ;
ofn.lpstrFileTitle = pstrTitleName ;
ofn.Flags = OFN_CREATEPROMPT ;
return GetOpenFileName (&ofn) ;
}
void PopFileSetFilter(TCHAR * pFilter)
{
if (pFilter == NULL)
ofn.lpstrFilter = szFilter;
else
ofn.lpstrFilter = pFilter;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -