#ifndef __MYU_WINDOWS_LIBRARY__mwl_filedlg_H__
#define __MYU_WINDOWS_LIBRARY__mwl_filedlg_H__

#include <mwlcommon.h>
#include <string>
#include <vector>

namespace mwl{


#ifndef OFN_FILEMUSTEXIST
	#include "mwlstd_ofn.h"
#endif//OFN_FILEMUSTEXIST

//	ファイルを開くダイアログ
#define DEFAULT_OFD_OFN_FLAGS	(OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR)
/*BOOL OpenFileDialogEx( HWND hWnd, char* szOutFilePath, int nBufSize, const char *szFilters, const char *szDialogTitle );
BOOL OpenFileDialogEx( HWND hWnd, char* szOutFilePath, int nBufSize, const char *szFilters, const char *szDialogTitle, DWORD dwFlags );
BOOL OpenFileDialogEx( HWND hWnd, vector<string> &filesOut, const char *szFilters, const char *szDialogTitle );
BOOL OpenFileDialogEx( HWND hWnd, vector<string> &filesOut, const char *szFilters, const char *szDialogTitle, DWORD dwFlags );

inline BOOL OpenFileDialog( HWND hWnd, char* szOutFilePath, int nBufSize, const char *szFilters ){
	return OpenFileDialogEx( NULL, szOutFilePath, nBufSize, szFilters, "開く" ); }
inline BOOL OpenFileDialog( HWND hWnd, char* szOutFilePath, int nBufSize, const char *szFilters, DWORD dwFlags ){
	return OpenFileDialogEx( NULL, szOutFilePath, nBufSize, szFilters, "開く", dwFlags ); }
inline BOOL OpenFileDialog( char* szOutFilePath, int nBufSize, const char *szFilters ){
	return OpenFileDialog( NULL, szOutFilePath, nBufSize, szFilters ); }
inline BOOL OpenFileDialog( char* szOutFilePath, int nBufSize, const char *szFilters, DWORD dwFlags ){
	return OpenFileDialog( NULL, szOutFilePath, nBufSize, szFilters, dwFlags ); }
*/
/*BOOL OpenFileDialogEx( HWND hWnd, char* szOutFilePath, int nBufSize, const char *szFilters, const char *szDialogTitle, DWORD dwFlags=DEFAULT_OFD_OFN_FLAGS );
BOOL OpenFileDialogEx( HWND hWnd, vector<string> &filesOut, const char *szFilters, const char *szDialogTitle,
					   DWORD dwFlags=DEFAULT_OFD_OFN_FLAGS|OFN_ALLOWMULTISELECT|OFN_EXPLORER );*/
BOOL OpenFileDialog( HWND hWnd, char* szOutFilePath, int nBufSize,
					const char *szFilters = "全てのファイル(*.*)\0*.*\0",
					const char *szDialogTitle = "開く",
					DWORD dwFlags=DEFAULT_OFD_OFN_FLAGS );

inline BOOL OpenFileDialog( char* szOutFilePath, int nBufSize,
					const char *szFilters = "全てのファイル(*.*)\0*.*\0",
					const char *szDialogTitle = "開く",
					DWORD dwFlags=DEFAULT_OFD_OFN_FLAGS )
{
	return OpenFileDialog( NULL, szOutFilePath, nBufSize, szFilters, szDialogTitle, dwFlags );
}

BOOL OpenFileDialog( HWND hWnd, vector<string> &filesOut,
					const char *szFilters = "全てのファイル(*.*)\0*.*\0",
					const char *szDialogTitle = "開く",
					DWORD dwFlags=DEFAULT_OFD_OFN_FLAGS );

/*inline BOOL OpenFileDialog( HWND hWnd, char* szOutFilePath, int nBufSize, const char *szFilters, DWORD dwFlags=DEFAULT_OFD_OFN_FLAGS ){
	return OpenFileDialogEx( NULL, szOutFilePath, nBufSize, szFilters, "開く", dwFlags ); }
inline BOOL OpenFileDialog( char* szOutFilePath, int nBufSize, const char *szFilters, DWORD dwFlags=DEFAULT_OFD_OFN_FLAGS ){
	return OpenFileDialog( NULL, szOutFilePath, nBufSize, szFilters, dwFlags ); }*/


//BOOL SaveFileDialogEx( HWND hWnd, char* szOutFilePath, int nBufSize, const char *szFilters, const char *szDialogTitle, DWORD dwFlags=OFN_OVERWRITEPROMPT );
BOOL SaveFileDialogEx( HWND hWnd, char* szOutFilePath, int nBufSize,
	const char *szFileTypeLabel, const char* szFileNameFilter, const char *szDialogTitle, DWORD dwFlags=OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR );


void NullSepStrTokenize( const char* szTargetStr, int nBufSize, vector<string> &listout );
void OfnFileListToVector( const char* szTargetStr, int nBufSize, vector<string> &listout );

}//namespace mwl


#endif//__MYU_WINDOWS_LIBRARY__mwl_filedlg_H__
