?? filedlg.h
字號:
/********************************************************************
Copyright 2006-2008 ZHANG Luduo. All Rights Reserved.
Permission to use, copy, modify, distribute and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation.
********************************************************************/
/*
代碼說明 :
打開, 保存, 目錄瀏覽對話框之調用
聯系方式:
作者 - 張魯奪
MSN - zhangluduo@msn.com
Email - zhangluduo@163.com
QQ群 - 34064264, 56918155
為所有愛我的人和我愛的人努力!
*/
#ifndef _FILEDLG_H
#define _FILEDLG_H
#pragma warning(disable : 4786)
#include <vector>
#include <string>
#include <functional>
#include <algorithm>
using namespace std;
#include "Thunk.h"
#define _FILEDLG_BUFSIZE 524288 // 1024 * 1024 / 2 = 524288, 此值在有些情況下必須小于1M!
class FileDlg
{
private:
Thunk m_ThunkOpen;
Thunk m_ThunkSave;
Thunk m_ThunkBrowse;
string m_InitDir;
char* m_OpenNameBuf;
char* m_SaveNameBuf;
char* m_BrowseNameBuf;
protected:
virtual UINT_PTR OpenProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual UINT_PTR SaveProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual int BrowseProc (HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
public:
// 此結構體為win2000以上操作系統定制
typedef struct tagOFNEX : public OPENFILENAME
{
void* pvReserved;
DWORD dwReserved;
DWORD FlagsEx;
} OPENFILENAMEEX, *POPENFILENAMEEX;
OPENFILENAMEEX m_OFNOpen;
OPENFILENAMEEX m_OFNSave;
BROWSEINFO m_BIFBrowse;
FileDlg();
virtual ~FileDlg();
vector<string> GetOpenFileName(HWND hWnd, bool bMulti = false, char* szFilter = NULL, char* szInitName = "\0");
string GetSaveFileName(HWND hWnd, bool AutoAddSuffixName = true, char* szFilter = NULL, char* szInitName = "\0");
string GetBrowseForFolder(HWND hWnd, char* szInitPath = "\0");
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -