⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filedlg.h

📁 SHA家族加密算法实现方式, C语言版本
💻 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 + -