#include "stdafx.h"

#ifndef _AFX	// MFC _xZkqqHx_iCpAiOgHiCoNiCmIiCkCiPoKiNiHiBeC_xHqqkZx_
#include <Windows.h>			// For FCDbFileDialog::OPENFILENAME.
#endif//_AFX

#include <dlgs.h>				// For edt1.
#include "resource.h"			// For IDS_XXX.
#include "UtilStr.h"			// For FFExtractUntil.
#include "UtilDlg.h"			// For FFSetDlgItemText.
#include "UtilWin.h"			// For FFSetWindowText.
#include "UtilFile.h"			// For FFGetFileExtension.
#include "UtilErr.h"			// For FFDebugTrace.
// 06.04.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//#include "UtilMisc.h"			// For FFVersionInfo.
#include "DbFileDialog.h"		// This header.

#ifdef _AFX	// MFC _xZkqqHx_iCpAiOgHiCkEiPoKiNiHiBeC_xHqqkZx_
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#endif//_AFX

//
// _xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiNfMjBkCiBeC_xHqqkZx_
//
// _xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmNiBeBiImIiJlKiCmMiCoGiCkEiCmJiDeFiDeCiDjDiDgIiDeFiCkKiCfBiPgEiNfMjBkCiCmJ_xHqqkZx_
// _xZkqqHx_iCmIiCmBiCmEiCkCiCoJiBeC_xHqqkZx_
// 
// _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkC_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_   TopDialogWindow                                              _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkC_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_  UserDefWindow                                         _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_ _xZkqqHx_iDiGiBfLiDfFjCoIiLgAiCmMiDgFiDjDiDhGiDiMiBfLiDgHiDiMiDeDiDeBiDeFiDgH_xHqqkZx_                     _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkD_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_               _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkGiEjPiEkC_xHqqkZx_                   _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_   _xZkqqHx_jFnLjBlGiClHiCoJiPoKiPiKiEkA_xHqqkZx_                      _xZkqqHx_iEkAiBkFiEkA_xHqqkZx_                   _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_               _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkIiEjPiEkD_xHqqkZx_                   _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkC_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_                                                        _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkD_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_                 _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkC_xHqqkZx_ _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEkC_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_   _xZkqqHx_iDhEiDeAiDeDiDiLjGlM_xHqqkZx_    _xZkqqHx_iEkA_xHqqkZx_                          _xZkqqHx_iEkA_xHqqkZx_ _xZkqqHx_iEkA_xHqqkZx_ _xZkqqHx_jFnLjBlG_xHqqkZx_     _xZkqqHx_iEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_                 _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkD_xHqqkZx_ _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEkD_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_                 _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkGiEjPiEkC_xHqqkZx_ _xZkqqHx_iEkBiEjPiEjPiEjPiEjPiEjPiEkC_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_   _xZkqqHx_iDhEiDeAiDeDiDiLiCmMiOoNjHnOiEkA_xHqqkZx_                      _xZkqqHx_iEkAiBkFiEkA_xHqqkZx_ _xZkqqHx_iEkAiDeMiDiDiDjDiDfKiDiLiEkA_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkA_xHqqkZx_                 _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkIiEjPiEkD_xHqqkZx_ _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEkD_xHqqkZx_  _xZkqqHx_iEkA_xHqqkZx_
// _xZkqqHx_iEkEiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEjPiEkD_xHqqkZx_
// 
// m_hWnd _xZkqqHx_iCmNiBeB_xHqqkZx_UserDefWindow _xZkqqHx_iCmMiDeFiDeCiDjDiDgIiDeFiDgOiDjDiDgIiDiLiCpAiLeMjIfOiClFiCmEiCkCiCoJiBeC_xHqqkZx_
// _xZkqqHx_iClBiCmMiClNiCnPiBeBjFnLjBlGiDhLiDfOiDjDiCoCiDeMiDiDiDjDiDfKiDiLiDhLiDfOiDjDjDjJiCpAiOoGjDlOiClHiCoJiCmJiCmNiBeB_xHqqkZx_GetParent(m_hWnd)_xZkqqHx_iCmJ_xHqqkZx_
// _xZkqqHx_jBmOiClFiCmEiKnGjAjEiCpAiOmAiNhDiClHiCoJjFeLjHhGiCkKiCkAiCoJiBeC_xHqqkZx_
// 
// myDlgParentProc_xZkqqHx_iKnGjAjEiCmN_xHqqkZx_ TopDialogWindow _xZkqqHx_iCmMiDhGiDiNiDfGiDfHiDiDiBeB_xHqqkZx_OFNHookProc_xZkqqHx_iKnGjAjEiCmN_xHqqkZx_
// UserDefWindow _xZkqqHx_iCmMiDhGiDiNiDfGiDfHiDiDiCmFiCkAiCoJiBeC_xHqqkZx_
//

const long FCDbFileDialog::MAX_PATH_STR_LEN = 4096;

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::FCDbFileDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	bOpenFileDialog	:_xZkqqHx_jDmHiCnNiPgPiClFiDfPiDeDiDeBiDiNiDePiCmMiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeBiPjBiCkLiNjOiCnN_xHqqkZx_
 *							 _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wcpDefExt		:_xZkqqHx_iKpJjCoIiCmMiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAiOhHjCoIiBeCiDhEiDeAiDeDiDiLjGlMjHhAiCmM_xHqqkZx_
 *							 _xZkqqHx_iDeHiDgGiDeCiDgCiDgHiDhLiDgCiDeOiDfIiCmJiBeBiDiGiBfLiDfFiBfLiCkKiKgHjCkDiOhBiCpAjFhEiCkPiClIiCmJ_xHqqkZx_
 *							 _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCpAjDpMjHmNiClFiClNiCmGiCkLiCmNiBeBiClBiCmMiKgHjCkDiOhBiCkKiOkJjDkOjDeJiCmJ_xHqqkZx_
 *							_xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCmJjCmHiJmBiClDiCoKiCnMiClHiBeC_xHqqkZx_
 *							NULL_xZkqqHx_iCpAiOhHjCoIiClHiCoJiCmGiBeBiKgHjCkDiOhBiCmNjCmHiJmBiClDiCoKiCnMiClJiCpBiBeC_xHqqkZx_
 *			wcpFileName		:_xZkqqHx_iDhEiDeAiDeDiDiLjGlMjHhAiCmMiDeHiDgGiDeCiDgCiDgHiDhLiDgCiDeOiDfIiCmJiPiJiKpKjFfMiOkGiClDiCoKiCoJ_xHqqkZx_
 *							_xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiClHiCoJiCmGiBeBiJlNiCoAjFfMiOkGiClDiCoKiCnMiClJiCpBiBeC_xHqqkZx_
 *			dwFlags			:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiDhLiDgCiDeOiDfIiCpAiDeKiDfIiDfOiDhNiDeDiDfJiClHiCoJiClNiCnPiCmMiDhEiDiJiDePiCpAiOhHjCoIiBeC_xHqqkZx_
 *			wcpFilter		:_xZkqqHx_iDhEiDeAiDeDiDiLiCpAjDmBjCoIiClHiCoJiClNiCnPiCmMiDhEiDeCiDiLiDfOiCpAiOhHjCoIiClHiCoJjFlGiOjKjHpBiCmM_xHqqkZx_
 *							 _xZkqqHx_jBgHiCnNiNiHiCoNiClJiCpAiOhHjCoIiBeC_xHqqkZx_
 *			hwndParent		:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiDhLiDgCiDeOiDfIiDeJiDhFiDfHiDeGiDeOiDgHiCmMjAgFiDeFiDeCiDjDiDgIiDeFiCnMiClNiCmN_xHqqkZx_
 *							 _xZkqqHx_iDeJiBfLiDgJiBfL_xHqqkZx_ _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCnGiCmMiDhMiDeDiDjDiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			wcpTitle		:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDfOiDeDiDgHiDiLiCpAiOhHjCoIiBeCiDgGiDhEiDeIiDiLiDgHiDfOiDeDiDgHiDiLiCpA_xHqqkZx_
 *							 _xZkqqHx_iOgHiCkEiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCDbFileDialog::FCDbFileDialog (BOOL bOpenFileDialog,
								const wchar_t* wcpDefExt,
								const wchar_t* wcpFileName,
								DWORD dwFlags,
								const wchar_t* wcpFilter,
								HWND hwndParent,
								const wchar_t* wcpTitle,
								const DWORD* pCtrlIdArray,
								const wchar_t** pCtrlTextArray,
								size_t szCtrlTextCount,
								BOOL bIsJustifyWindow)
{
	m_bOpenFileDialog = bOpenFileDialog;
// 06.01.21 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	m_dwHelpId = DWORD(-1);
	m_lLastFilterIndex = -1;
	m_hWnd = NULL;
	m_parentProc = NULL;
	m_vFileName.assign(MAX_PATH_STR_LEN, _T('\0'));
	const _TCHAR* tcpDefExt = NULL;
	const _TCHAR* tcpFilter = NULL;
	const _TCHAR* tcpTitle = NULL;
	if (wcpDefExt != NULL)
	{
		m_strDefExt = WStrToTStr(wcpDefExt);
		tcpDefExt = m_strDefExt.c_str();
	}
	if (wcpFileName != NULL)
	{
		_tcsncpy(&m_vFileName.at(0), WStrToTStr(wcpFileName), MAX_PATH_STR_LEN - 1);
		m_vFileName.at(MAX_PATH_STR_LEN - 1) = _T('\0');
	}
	if (wcpFilter != NULL)
	{
		// _xZkqqHx_jHoBiBeG_xHqqkZx_wcpFilter = L"Dynamic Draw Projects (*.mdpj)|*.mdpj|All Files (*.*)|*.*||"
		//     m_vFilter = _T("Dynamic Project Files (*.mdpj)\0*.mdpj\0All Files (*.*)\0*.*\0\0");
		WString wstrFilter = wcpFilter;
		while (!wstrFilter.IsEmpty())
		{
			WString wstrItem = FFExtractUntil(wstrFilter, L'|');
			tcstring tstrItem = (const _TCHAR*)WStrToTStr(wstrItem);
			m_vFilter.insert(m_vFilter.end(),
							tstrItem.c_str(),
							tstrItem.c_str() + (sizeof(_TCHAR) * tstrItem.length()));
			m_vFilter.push_back(_T('\0'));
		}
		if (!m_vFilter.empty())
			tcpFilter = &m_vFilter.at(0);
	}
	if (wcpTitle != NULL)
	{
		m_strTitle = (const _TCHAR*)WStrToTStr(wcpTitle);
		tcpTitle = m_strTitle.c_str();
	}
//----- 05.10.13 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	if (hwndParent == NULL)
//		hwndParent = FFGetMainWnd()->GetSafeHwnd();
//----- 05.10.13 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iClBiClBiCmFiDhEiDeIiDeBiDePiDiJiDeFiDjDiDgIiDeFiDeCiDjDiDgIiDeFiCpAjAnNjCoIiClFiCmIiCkCiCmGiBeB_xHqqkZx_
	// _xZkqqHx_iDhNiDeFiDfIiBeFiDeMiBfLiDeDiDhIiDjDiDgHiCpAiDhKiBfLiDiLiDgIiCmFiCkLiCmIiCkCiBeC_xHqqkZx_
	if (hwndParent == NULL)
		hwndParent = GetForegroundWindow();
//----- 05.10.13 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

	// _xZkqqHx_iImIiJlKiCmM_xHqqkZx_ OPENFILENAME _xZkqqHx_iCmNiBeB_xHqqkZx_OFN_ENABLEHOOK _xZkqqHx_iCpAiOhHjCoIiClHiCoJiCmG_xHqqkZx_
	// OFN_EXPLORER _xZkqqHx_iCpAiOhHjCoIiClFiCmEiCkCiCmEiCoA_xHqqkZx_ Win2000/XP_xZkqqHx_iDfIiDfOiDeDiDiLiCmM_xHqqkZx_
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmJiCmNiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
	// _xZkqqHx_iClBiCoKiCmNiBeB_xHqqkZx_OPENFILENAME_xZkqqHx_iNfMjBkCjBmMiCkKiMmDiCkCiClNiCnPiBeC_xHqqkZx_
	// _xZkqqHx_jAfGiClFiCkC_xHqqkZx_SDK_xZkqqHx_iCmFiCmN_xHqqkZx_ OPENFILENAME_xZkqqHx_iNfMjBkCjBmMiCmNiKgHjCkDiClDiCoKiCmEiCkIiCoIiBeB_xHqqkZx_
	// _xZkqqHx_iClLiCoKiCpAjHhAiCkCiCoKiCmO_xHqqkZx_ Win2000/XP_xZkqqHx_iDfIiDfOiDeDiDiLiCmGiCmIiCoJiBeC_xHqqkZx_
	// _xZkqqHx_jCeBiClFiBeB_xHqqkZx_98/Me _xZkqqHx_iCmFjDkOiNoMiClFiCmIiCkCiBeBiCnMiClNiDeDiDhIiDjDiDgHiCmMiJpBiCoIjFpLiCkK_xHqqkZx_
	// _xZkqqHx_iInJiCmIiCoJiClNiCnPiBeBiDhGiDiNiDePiDiJiDiAiCmJiPeDjAlDiCkKjFeLjHhGiBeBiCmIiCmHiOoIiKnEiCkKiCkJiCkJiCoJiBeC_xHqqkZx_
	// _xZkqqHx_iClLiCmMiClNiCnPiBeBiCmGiCoIiCkAiCkGiClIiCmNiLiMiDfIiDfOiDeDiDiLiCpAiInLiOjNiClHiCoJiBeC_xHqqkZx_

	memset(&m_ofn, 0, sizeof(m_ofn));
	m_ofn.lStructSize		= sizeof(m_ofn);
	m_ofn.hwndOwner			= hwndParent;
	m_ofn.hInstance			= NULL;
	m_ofn.lpstrFilter		= tcpFilter;
	m_ofn.lpstrCustomFilter = NULL;
	m_ofn.nFilterIndex		= 0;
	m_ofn.lpstrFile			= &m_vFileName.at(0);
	m_ofn.nMaxFile			= MAX_PATH_STR_LEN;
	m_ofn.lpstrFileTitle	= NULL;
	m_ofn.nMaxFileTitle		= 0;
	m_ofn.lpstrInitialDir	= _T(".");
	m_ofn.lpstrTitle		= tcpTitle;
	m_ofn.Flags				= dwFlags|OFN_EXPLORER|OFN_ENABLEHOOK|OFN_ENABLESIZING;
	m_ofn.nFileOffset		= 0;
	m_ofn.nFileExtension	= 0;
	m_ofn.lpstrDefExt		= tcpDefExt;
	m_ofn.lCustData			= (LPARAM)this;
	m_ofn.lpfnHook			= (LPOFNHOOKPROC)OFNHookProc;
	m_ofn.lpTemplateName	= NULL;



//	m_ofn.lpstrFilter		= _T("Project Files (*.mdpj)\0*.mdpj\0ProjeXX Files (*.mdxx)\0*.mdxx\0All Files (*.*)\0*.*\0\0");

	size_t n;
	for (n = 0; n != szCtrlTextCount; n++)
		m_mpIdToText[pCtrlIdArray[n]] = pCtrlTextArray[n];
	m_bIsJustifyWindow = bIsJustifyWindow;
} // FCDbFileDialog::FCDbFileDialog.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::DoModal
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCpAiDiCiBfLiDfPiDiLiCmFjFfMiOkGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iPeJjHlJiOjOiCmJiJjPiClDiCoKiClNiDhLiDfOiDjDiCmM_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCDbFileDialog::DoModal ()
{
	ASSERT(m_ofn.lpstrFile != NULL);
	ASSERT(m_ofn.lpstrDefExt == NULL);
	ASSERT(m_ofn.nFilterIndex == 0);

	// _xZkqqHx_jAnNjCoIiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiLjGlMiCmMiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAiOoGjDlOiBeC_xHqqkZx_
	WString wstrExtension = FFGetFileExtension(TStrToWStr(m_ofn.lpstrFile));
	// _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCmJiIoKjChGiClHiCoJiDhEiDeCiDiLiDfOiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOoGjDlOiBeC_xHqqkZx_
	longSet stIndex;
	FindFilterFileExt(stIndex, wstrExtension);
	if (stIndex.empty())
	//----- _xZkqqHx_iIoKjChGiClHiCoJiDhEiDeCiDiLiDfOiCkKjGlDiCkCiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iNmFiPiJiCmMiDhEiDeCiDiLiDfOiCmMiKgHjCkDiOhBiCpAiDgGiDhEiDeIiDiLiDgHiCmJjAnNjCoIiBeC_xHqqkZx_
		stIndex.insert(0);
		GetFilterFileExt(wstrExtension, 0);
	}
	// _xZkqqHx_iDgGiDhEiDeIiDiLiDgHiCmMiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAjAnNjCoIiBeC_xHqqkZx_
	// lpstrDefExt _xZkqqHx_iCmNiBeBiDhDiDiKiDeJiDgIiCpAiKnMiCpBiCmFiCmNiCkCiCkPiCmIiCkCiBeC_xHqqkZx_
	m_strDefExt = WStrToTStr((const wchar_t*)wstrExtension + 1);
	m_ofn.lpstrDefExt = LPTSTR(m_strDefExt.c_str());
	m_ofn.nFilterIndex = *stIndex.begin() + 1;

	if (m_bOpenFileDialog)
		return GetOpenFileName(&m_ofn) ? IDOK : IDCANCEL;
	else
		return GetSaveFileName(&m_ofn) ? IDOK : IDCANCEL;
} // FCDbFileDialog::DoModal.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetPathName
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePjFfMiOkGiOjOiCmNiBeBiMlLiNnNiDhEiDeAiDeDiDiLiDiKiDfIiDgHiCmFjBeJjBpAiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiL_xHqqkZx_
 *			_xZkqqHx_iIlNiCkCiCmNiDgGiDeCiDiMiDeOiDgHiDiKiCmMiDhEiDiLiDhAiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *			_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiPeJjHlJiOjOiCmNiBeBjDlOiCoHiCoKiClNiDhEiDeAiDeDiDiLiIlNiCkCiCmNiDgGiDeCiDiMiDeOiDgHiDiKiCmM_xHqqkZx_
 *			_xZkqqHx_iDhEiDiLiDhAiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiCmMiDhEiDiLiDhAiDfIjGlMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.14 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
WString FCDbFileDialog::GetPathName () const
{
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePjFfMiOkGiOjOiCmNiDfPiDeDiDeBiDiNiDePiCkJiCoHiPoOjFpBiCpAiOoGjDlOiBeCjEpBjFfMiOkGiOjOiCmNiDgPiDgCiDhEiDeAiDgGiBfLiDfOiCpAjFnEiClHiBeC_xHqqkZx_
	if (::IsWindow(m_hWnd))
	{
		_TCHAR szFileName[MAX_PATH_STR_LEN];
		TwSendMessage(CDM_GETFILEPATH, MAX_PATH_STR_LEN, (LPARAM)szFileName);
		return TStrToWStr(szFileName);
	} else
	{
		return TStrToWStr(&m_vFileName.at(0));
	}
} // FCDbFileDialog::GetPathName.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetFileName
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMlLiNnNiCmMiDhEiDeAiDeDiDiLjGlMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLjGlMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePjFfMiOkGiOjOiCmFiCmIiCkCiCmGjDkOiNoMiClFiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
WString FCDbFileDialog::GetFileName () const
{
	_TCHAR szFileName[MAX_PATH_STR_LEN];
	if (::IsWindow(m_hWnd))
		TwSendMessage(CDM_GETSPEC, MAX_PATH_STR_LEN, (LPARAM)szFileName);
	else
		FFThrowMiscUnknown();
	return TStrToWStr(szFileName);
} // FCDbFileDialog::GetFileName.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetFolderPath
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMlLiNnNiCmMiDgGiDeCiDiMiDeOiDgHiDiKiCmMiDhAiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhAiDfIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePjFfMiOkGiOjOiCmFiCmIiCkCiCmGjDkOiNoMiClFiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
WString FCDbFileDialog::GetFolderPath () const
{
	_TCHAR szFileName[MAX_PATH_STR_LEN];
	if (::IsWindow(m_hWnd))
		TwSendMessage(CDM_GETFOLDERPATH, MAX_PATH_STR_LEN, (LPARAM)szFileName);
	else
		FFThrowMiscUnknown();
	return TStrToWStr(szFileName);
} // FCDbFileDialog::GetFolderPath.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::SetFileName
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDhEiDeAiDeDiDiLjGlMiCpAiDhEiDeAiDeDiDiLjGlMiDeHiDgGiDeCiDgCiDgHiDhLiDgCiDeOiDfIiCmJjDpMjHmNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpName	:_xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePjFfMiOkGiOjOiCmFiCmIiCkCiCmGjDkOiNoMiClFiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.14 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::SetFileName (const wchar_t* wcpName)
{
	if (::IsWindow(m_hWnd))
		TwSendMessage(CDM_SETCONTROLTEXT, edt1, (LPARAM)(const _TCHAR*)WStrToTStr(wcpName));
	else
		FFThrowMiscUnknown();
} // FCDbFileDialog::SetFileName.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetCurrentFilterIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMlLiNnNjBeJjBpAiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiLiDfOiDeDiDhGiBgJiDhEiDeCiDiLiDfOiBfLiBgKiCmMiDeDiDjDiDgGiDgCiDeOiDfI_xHqqkZx_
 *			_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhEiDeCiDiLiDfOiBfLiCmMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDhEiDeCiDiLiDfOiBfLiDeDiDjDiDgGiDgCiDeOiDfIiCmNiBeBiIoKjEnEiNmFiPiJiBgJiPoDiBgKiCmMiDhEiDeCiDiLiDfOiBfLiCkKiCePiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.14 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
long FCDbFileDialog::GetCurrentFilterIndex () const
{
	return long(m_ofn.nFilterIndex - 1);
} // FCDbFileDialog::GetCurrentFilterIndex.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetFilterFileExt
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeCiDiLiDfOjCiGiCmMiBeBiOhHjCoIiCmMiDeDiDjDiDgGiDgCiDeOiDfIiCmMiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wstrExt			:_xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAjFnEiClHiBeCjHoB_xHqqkZx_:_xZkqqHx_iBhF_xHqqkZx_.mdrw_xZkqqHx_iBhG_xHqqkZx_
 *			lFilterIndex	:_xZkqqHx_iDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDeDiDjDiDgGiDgCiDeOiDfIiCmJjBmOiJjOiClHiCoJiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCkKiMkJiCmCiCkJiCmBiClNiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_jFnEjCgMiCmNiBeBiOhHjCoIiClDiCoKiClNiDeDiDjDiDgGiDgCiDeOiDfIiCkKiLeMjIfOiClDiCoKiClNiDhEiDeCiDiLiDfOiBfLjAjEiCpA_xHqqkZx_
 *			_xZkqqHx_jClEiCkGiClNiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
 *			_xZkqqHx_jFnEjCgMiCkK_xHqqkZx_TRUE_xZkqqHx_iCmFiCkAiCmBiCmEiCoAiBeBiCfAiCmCiCmMiDhEiDeCiDiLiDfOiBfLiCmJjFkBjAjEiCmMiKgHjCkDiOhBiCkKiLeMjIfO_xHqqkZx_
 *			_xZkqqHx_iClDiCoKiCmEiCkCiCoJiPoKiNiHiCmNiBeB_xHqqkZx_wstrExt_xZkqqHx_iCkK_xHqqkZx_Empty_xZkqqHx_iCmGiCmIiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.04.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCDbFileDialog::GetFilterFileExt (WString& wstrExt, long lFilterIndex) const
{
	wstrExt.Empty();
	const _TCHAR* tcpFilter = m_ofn.lpstrFilter;
	for (long lC = 0; *tcpFilter != _T('\0'); lC++)
	{
		tcpFilter += _tcslen(tcpFilter);	// _xZkqqHx_iDhEiDeCiDiLiDfOjGlMiCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
											// _xZkqqHx_jHoBiBeG_xHqqkZx_Dynamic Draw Standard Format (*.mdrw)
		tcpFilter++;						// _xZkqqHx_iLoGjAnIiCoIiCmM_xHqqkZx_'\0'_xZkqqHx_iCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
		if (lC == lFilterIndex)
		{
			// _xZkqqHx_iKgHjCkDiOhBiBeC_xHqqkZx_";"_xZkqqHx_iCmFjAnKjBlBiClDiCoKiClNjFkBjAjEiCmMiPoKiNiHiCoAiCkAiCoJiBeC_xHqqkZx_
			WString wstrExts = TStrToWStr(tcpFilter);
			if (wstrExts.Find(L';') == -1)
			//----- _xZkqqHx_iKgHjCkDiOhBjCiGiCmJ_xHqqkZx_';'_xZkqqHx_iCkKiMkJiCmCiCkJiCoHiCmIiCkCiPoKiNiH_xHqqkZx_ -----
			{
				wstrExt = (const wchar_t*)wstrExts + 1;
			}
			return TRUE;
		}
		tcpFilter++;						// _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCmM_xHqqkZx_'*'_xZkqqHx_iCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
											// _xZkqqHx_jHoBiBeG_xHqqkZx_*.mdrw
		tcpFilter += _tcslen(tcpFilter);	// _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
											// _xZkqqHx_jHoBiBeG_xHqqkZx_.mdrw
		tcpFilter++;						// _xZkqqHx_iLoGjAnIiCoIiCmM_xHqqkZx_'\0'_xZkqqHx_iCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
	}
	return FALSE;
} // FCDbFileDialog::GetFilterFileExt.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::FindFilterFileExt
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiCmMiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCmJiIoKjChGiClHiCoJiBeBiDhEiDeCiDiLiDfOiCmMiDeDiDjDiDgGiDgCiDeOiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	stIndex	:_xZkqqHx_iIoKjChGiClFiClNiDeDiDjDiDgGiDgCiDeOiDfIiCmMiPfHiNiHiCpAjFnEiClHiBeC_xHqqkZx_
 *			wcpExt	:_xZkqqHx_iMjPiNpFiClHiCoJiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAiOhHjCoIiBeCjHoB_xHqqkZx_:_xZkqqHx_iBhF_xHqqkZx_.mdrw_xZkqqHx_iBhG_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.04.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::FindFilterFileExt (longSet& stIndex, const wchar_t* wcpExt) const
{
	const _TCHAR* tcpFilter = m_ofn.lpstrFilter;
	for (long lC = 0; *tcpFilter != _T('\0'); lC++)
	{
		tcpFilter += _tcslen(tcpFilter);	// _xZkqqHx_iDhEiDeCiDiLiDfOjGlMiCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
											// _xZkqqHx_jHoBiBeG_xHqqkZx_Dynamic Draw Standard Format (*.mdrw)
		tcpFilter++;						// _xZkqqHx_iLoGjAnIiCoIiCmM_xHqqkZx_'\0'_xZkqqHx_iCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
		WString wstrExts = TStrToWStr(tcpFilter);
		while (!wstrExts.IsEmpty())
		{
			// _xZkqqHx_jFlGiOjKjHpBiCkJiCoH_xHqqkZx_';'_xZkqqHx_iCmFiLoGjAnIiCoHiCoKiCoJjAoGjDkKiCmMjFlGiOjKjHpBiCpAiOoGiCoIiPgPiClHiBeC_xHqqkZx_
// 06.03.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//			WString wstrExt = FFExtractUntil(wstrExts, L";");
			WString wstrExt = FFExtractUntil(wstrExts, L';');
			if (wcsicmp(wcpExt, (const wchar_t*)wstrExt + 1) == 0)
			{
				stIndex.insert(lC);
				break;
			}
		}
		tcpFilter += _tcslen(tcpFilter);	// _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
											// _xZkqqHx_jHoBiBeG_xHqqkZx_*.mdrw
		tcpFilter++;						// _xZkqqHx_iLoGjAnIiCoIiCmM_xHqqkZx_'\0'_xZkqqHx_iCpAiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
	}
} // FCDbFileDialog::FindFilterFileExt.

//----- 06.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::SetHelpID
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDhHiDiLiDhG_xHqqkZx_ID_xZkqqHx_iCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwId	:_xZkqqHx_iDhHiDiLiDhG_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDhHiDiLiDhGiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiCmGiCkLiBeBiOhHjCoIiClDiCoKiClNiDhHiDiLiDhG_xHqqkZx_ID_xZkqqHx_iCmJ_xHqqkZx_
// *			_xZkqqHx_jBmOiJjOiClHiCoJiDhHiDiLiDhGiCkKjFfMiOkGiClDiCoKiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCDbFileDialog::SetHelpID (DWORD dwId)
//{
//	m_dwHelpId = dwId;
//} // FCDbFileDialog::SetHelpID.
//----- 06.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::PostMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCmJiDiBiDgCiDfKiBfLiDfHiCpAiDhMiDfIiDgHiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwMessageId	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iPiIjHjNiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCDbFileDialog::PostMessage (DWORD dwMessageId, WPARAM wParam, LPARAM lParam)
{
	return ::PostMessage(m_hWnd, dwMessageId, wParam, lParam);
} // FCDbFileDialog::PostMessage.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::SendMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCmJiDiBiDgCiDfKiBfLiDfHiCpAiDfKiDjDiDgIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwMessageId	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iPiIjHjNiMiLiJmKiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
LRESULT FCDbFileDialog::SendMessage (DWORD dwMessageId, WPARAM wParam, LPARAM lParam)
{
	return ::SendMessage(m_hWnd, dwMessageId, wParam, lParam);
} // FCDbFileDialog::SendMessage.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::ScreenToClient
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfIiDeOiDiKiBfLiDjDiNmAjFfHiMgOiCmMiNmAjFfHjCgMiCpAiDeOiDiJiDeDiDeBiDjDiDgHiNmAjFfHiMgOiCmMiNmAjFfHjCgMiCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpPoint	:_xZkqqHx_iDfIiDeOiDiKiBfLiDjDiNmAjFfHjCgMiCpAiOhHjCoIiBeCiDeOiDiJiDeDiDeBiDjDiDgHiNmAjFfHjCgMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::ScreenToClient (LPPOINT lpPoint) const
{
	::ScreenToClient(m_hWnd, lpPoint);
} // FCDbFileDialog::ScreenToClient.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::ScreenToClient
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfIiDeOiDiKiBfLiDjDiNmAjFfHiMgOiCmMiNmAjFfHjCgMiCpAiDeOiDiJiDeDiDeBiDjDiDgHiNmAjFfHiMgOiCmMiNmAjFfHjCgMiCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpRect	:_xZkqqHx_iDfIiDeOiDiKiBfLiDjDiNmAjFfHjCgMiCpAiOhHjCoIiBeCiDeOiDiJiDeDiDeBiDjDiDgHiNmAjFfHjCgMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::ScreenToClient (LPRECT lpRect) const
{
//----- 06.01.20 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	CPoint ptTopLeft = CRect(lpRect).TopLeft();
//	CPoint ptBottomRight = CRect(lpRect).BottomRight();
//	::ScreenToClient(m_hWnd, &ptTopLeft);
//	::ScreenToClient(m_hWnd, &ptBottomRight);
//	*lpRect = CRect(ptTopLeft, ptBottomRight);
//----- 06.01.20 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	POINT ptTopLeft = { lpRect->left, lpRect->top };
	POINT ptBottomRight = { lpRect->right, lpRect->bottom };
	::ScreenToClient(m_hWnd, &ptTopLeft);
	::ScreenToClient(m_hWnd, &ptBottomRight);
	lpRect->left = ptTopLeft.x;
	lpRect->top = ptTopLeft.y;
	lpRect->right = ptBottomRight.x;
	lpRect->bottom = ptBottomRight.y;
//----- 06.01.20 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
} // FCDbFileDialog::ScreenToClient.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetClientRect
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDeOiDiJiDeDiDeBiDjDiDgHjHmMiIoGiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpRect	:_xZkqqHx_iDeOiDiJiDeDiDeBiDjDiDgHjHmMiIoGiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::GetClientRect (LPRECT lpRect) const
{
	::GetClientRect(m_hWnd, lpRect);
} // FCDbFileDialog::GetClientRect.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetWindowRect
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDeFiDeCiDjDiDgIiDeFjHmMiIoGiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpRect	:_xZkqqHx_iDeFiDeCiDjDiDgIiDeFjHmMiIoGiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::GetWindowRect (LPRECT lpRect) const
{
	::GetWindowRect(m_hWnd, lpRect);
} // FCDbFileDialog::GetWindowRect.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iPiJiKpKiJlLiCkKjAkMiMpHiClFiClNiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeBiOlIjEhDiClFiClNiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_FALSE_xZkqqHx_iCpAjFnEiClFiClN_xHqqkZx_
 *			_xZkqqHx_iPoKiNiHiCmNiDfPiDeDiDeBiDiNiDePiCkKiPeJjHlJiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCDbFileDialog::OnInitDialog ()
{
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	if (FFVersionInfo().dwPlatformId == VER_PLATFORM_WIN32_NT)
//	//----- WindowsNT_xZkqqHx_iMgOiCmMiPoKiNiH_xHqqkZx_ ------
//	{
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//		// IDOK_xZkqqHx_iCmNjChFiKlHiClFiCmEiCoAjGlDjBmKiBeCiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCmNiBeBiJlNiCkJiDeDiDhIiDjDiDgHiCmMjDhIiCmJ_xHqqkZx_
//		// IDOK_xZkqqHx_iCpAiPjBiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
//		// _xZkqqHx_jFnLjBlGiDfPiDeDiDeBiDiNiDePiCmFiCoA_xHqqkZx_ _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKjBeJjBpAiOjOiCmNiBhFiKeKiCkNiBhGiCmJiBeBjBeJjBpAiClFiCmEiCkCiCmIiCkC_xHqqkZx_
//		// _xZkqqHx_iCmGiCkLiCmNiBhFjFnLjBlGiBhGiCmJjFmPiNfIiClHiCoJiClNiCnPiBeC_xHqqkZx_
//		// _xZkqqHx_iKeKiCkN_xHqqkZx_ (&T)
//
//		// OK_xZkqqHx_iDhLiDfOiDjDiCmMjFlGiOjKiCpAiPmBiLiOiClFiCmEiJeCiClHiBeC_xHqqkZx_
//		// _xZkqqHx_iClNiClOiClFiBeB_xHqqkZx_EnableWindow _xZkqqHx_iCmFjGlDiMpIiCmJiClFiCmEiCmNiCkCiCkPiCmIiCkCiBeC_xHqqkZx_
//		// ENTER_xZkqqHx_iDeMiBfLiCmFjDpMjHmNiClDiClJiCoJiCmJiCmNiBeB_xHqqkZx_OK_xZkqqHx_iDhLiDfOiDjDiCkKjHeMiMpIiCmFiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
//		FFSetWindowText(TwGetDlgItemHwnd(IDOK), L"");
//		ShowWindow(TwGetDlgItemHwnd(IDOK), SW_HIDE);
//
//		// OK_xZkqqHx_iDhLiDfOiDjDiCmMiNmAjFfHiCpAiOoGjDlOiClFiCmEiDeOiDiJiDeDiDeBiDjDiDgHiNmAjFfHiCmJiBeC_xHqqkZx_
//		RECT rtOK;
//		::GetWindowRect(TwGetDlgItemHwnd(IDOK), &rtOK);
//		TwScreenToClient(&rtOK);
//		// OK_xZkqqHx_iDhLiDfOiDjDiCmGjDkPiClGiDfEiDeDiDfJiCmFjBoDjHjNiDhLiDfOiDjDiCpAiNoMjAkMiBeC_xHqqkZx_
//		::CreateWindowEx(0, _T("BUTTON"),
//				NULL, WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_DEFPUSHBUTTON|BS_TEXT,
//				rtOK.left, rtOK.top,
//				rtOK.right - rtOK.left, rtOK.bottom - rtOK.top,
//				TwGetHwnd(), HMENU(FD_DBFD_OK_BUTTON_ID), NULL, NULL);
//		// _xZkqqHx_jBoDjHjNiDhLiDfOiDjDiCmMiDfOiDhFiDeJiBfLiDfPiBfLiCpA_xHqqkZx_OK_xZkqqHx_iDhLiDfOiDjDiCmGjDkPiClGiImKjChFiCmJjAnNjCoIiClHiCoJiBeC_xHqqkZx_
//		SetWindowPos(TwGetDlgItemHwnd(FD_DBFD_OK_BUTTON_ID),
//					TwGetDlgItemHwnd(IDOK), 0, 0, 0, 0,
//					SWP_NOMOVE|SWP_NOSIZE);
//		// OK_xZkqqHx_iDhLiDfOiDjDiCmMiDhEiDeIiDjDiDgHiCpAjBoDjHjNiDhLiDfOiDjDiCmJjAnNjCoIiBeC_xHqqkZx_
//		HFONT hFont = (HFONT)::SendMessage(TwGetDlgItemHwnd(IDOK), WM_GETFONT, 0, 0);
//		::SendMessage(TwGetDlgItemHwnd(FD_DBFD_OK_BUTTON_ID), WM_SETFONT, WPARAM(hFont), 0);
//
//		//----- OK_xZkqqHx_iDhLiDfOiDjDiCmMjFfHiPiAiCmMjFfMiOkGiDiBiDgCiDfKiBfLiDfHiCpAjFmPiNfIiClHiCoJ_xHqqkZx_ -----
//		// _xZkqqHx_jFnLjBlG_xHqqkZx_(&S):
//// 06.04.20 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
////		FFSetDlgItemText(TwGetHwnd(), FD_DBFD_OK_BUTTON_ID, GetControlText(FD_DBFD_OK_BUTTON_ID));
//		FFSetDlgItemText(TwGetHwnd(), FD_DBFD_OK_BUTTON_ID, GetControlText(IDOK));
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	} else
//	//----- Windows95_xZkqqHx_iMgOiCmMiPoKiNiH_xHqqkZx_ -----
//	{
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
		//----- OK_xZkqqHx_iDhLiDfOiDjDiCmMjFfHiPiAiCmMjFfMiOkGiDiBiDgCiDfKiBfLiDfHiCpAjFmPiNfIiClHiCoJ_xHqqkZx_ -----
		// _xZkqqHx_jFnLjBlG_xHqqkZx_(&S):
		FFSetDlgItemText(TwGetHwnd(), IDOK, GetControlText(IDOK));
// 06.04.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	}

	//----- _xZkqqHx_jFfHiPiAiCmMjFfMiOkGiDiBiDgCiDfKiBfLiDfHiCpAjFmPiNfIiClHiCoJ_xHqqkZx_ -----
	// _xZkqqHx_iDhEiDeAiDeDiDiLiCmMiOoNjHnO_xHqqkZx_(&X):
	FFSetDlgItemText(TwGetHwnd(), stc2, GetControlText(stc2));
	// _xZkqqHx_iDhEiDeAiDeDiDiLjGlM_xHqqkZx_(&W):
	FFSetDlgItemText(TwGetHwnd(), stc3, GetControlText(stc3));
	// _xZkqqHx_iDeMiDiDiDjDiDfKiDiL_xHqqkZx_(&Q)
	FFSetDlgItemText(TwGetHwnd(), IDCANCEL, GetControlText(IDCANCEL));
	// Help (&1)
	FFSetDlgItemText(TwGetHwnd(), psh15, GetControlText(psh15));
	// _xZkqqHx_iDhEiDeAiDeDiDiLiCmMiPoKiPiK_xHqqkZx_(&E):
	FFSetDlgItemText(TwGetHwnd(), stc4, GetControlText(stc4));
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCpAiDhNiDeFiDfIiImKjChFiCmJiInKjDkOiBeC_xHqqkZx_
	if (m_bIsJustifyWindow)
		FFJustifyWindow(TwGetHwnd());
	return TRUE;
} // FCDbFileDialog::OnInitDialog.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnOK
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	OK_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnOK ()
{
} // FCDbFileDialog::OnOK.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnHelp
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	Help_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnHelp ()
{
// 06.01.21 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	FFGetApp()->WinHelp(HID_BASE_RESOURCE + m_dwHelpId);
} // FCDbFileDialog::OnHelp.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnDestroy
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	CWnd _xZkqqHx_iCkKjEgKiKpMiClDiCoKiCoJiCmGiCkLiCmJiMmEiCnBiPgPiClDiCoKiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.04.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnDestroy ()
{
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	if (FFVersionInfo().dwPlatformId == VER_PLATFORM_WIN32_NT)
//	//----- WindowsNT_xZkqqHx_iMgOiCmMiPoKiNiH_xHqqkZx_ ------
//	{
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//		// _xZkqqHx_iDhLiDfOiDjDiDeFiDeCiDjDiDgIiDeFiCpAiNoNiPjMiBeC_xHqqkZx_
//		::DestroyWindow(TwGetDlgItemHwnd(FD_DBFD_OK_BUTTON_ID));
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
// 06.04.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	}
} // FCDbFileDialog::OnDestroy.

//----- 06.01.21 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnCtlColor
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDfCiDjDiDgHiDiNiBfLiDiLiCpAjDgIiCoIiCmCiCnEiClHiNnLiCmMiDhFiDiJiDfGiCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC		:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *			pWnd	:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
// *			nCtlColor:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmMiOoNjHnOiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhFiDiJiDfGiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//HBRUSH FCDbFileDialog::OnCtlColor (CDC* pDC, CWnd* pWnd, UINT nCtlColor)
//{
////	AfxDebugBreak();
//	return (HBRUSH)DefWindowProc(	GetCurrentMessage()->hwnd,
//									GetCurrentMessage()->message,
//									GetCurrentMessage()->wParam,
//									GetCurrentMessage()->lParam);
//} // FCDbFileDialog::OnCtlColor.
//----- 06.01.21 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnCtlColor
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDfCiDjDiDgHiDiNiBfLiDiLiCpAjDgIiCoIiCmCiCnEiClHiNnLiCmMiDhFiDiJiDfGiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	hDC		:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pWnd	:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
 *			nCtlColor:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmMiOoNjHnOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhFiDiJiDfGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
HBRUSH FCDbFileDialog::OnCtlColor (HDC hDC, HWND hWnd, UINT nCtlColor)
{
//	AfxDebugBreak();
	return (HBRUSH)DefWindowProc(	GetCurrentMessage()->hwnd,
									GetCurrentMessage()->message,
									GetCurrentMessage()->wParam,
									GetCurrentMessage()->lParam);
} // FCDbFileDialog::OnCtlColor.
//----- 06.01.21 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnSize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDfEiDeDiDfJjFmPiNfIiCmMiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nType	:_xZkqqHx_iDfEiDeDiDfJjFmPiNfIiCmMiDfOiDeDiDhGiCpAiOhHjCoIiBeCiDhHiDiLiDhGiOfBiPmGiBeC_xHqqkZx_
 *			cx		:_xZkqqHx_jFmPiNfIiMoDiCmMiDfEiDeDiDfJiCpAiOhHjCoIiBeC_xHqqkZx_
 *			cy		:_xZkqqHx_jFmPiNfIiMoDiCmMiDfEiDeDiDfJiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnSize (UINT nType, int cx, int cy)
{
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	if (FFVersionInfo().dwPlatformId == VER_PLATFORM_WIN32_NT)
//	//----- WindowsNT_xZkqqHx_iMgOiCmMiPoKiNiH_xHqqkZx_ ------
//	{
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//		RECT rtOK;
//		::GetWindowRect(TwGetDlgItemHwnd(IDOK), &rtOK);
//		POINT pt1 = { rtOK.left, rtOK.top };
//		::ScreenToClient(TwGetHwnd(), &pt1);
//
//		// _xZkqqHx_jBoDjHjNiCgOiCgKiDhLiDfOiDjDiCpAiInKjDkOiBeC_xHqqkZx_
//		SetWindowPos(TwGetDlgItemHwnd(FD_DBFD_OK_BUTTON_ID),
//					NULL, pt1.x, pt1.y, 0, 0,
//					SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOOWNERZORDER|
//					SWP_NOSENDCHANGING|SWP_NOSIZE|SWP_NOZORDER);
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
// 06.04.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	}
} // FCDbFileDialog::OnSize.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnFileSelchanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiCmMiDiKiDfIiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmMjBeJjBpAiCkKjFmPiNfIiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnFileSelchanged ()
{
} // FCDbFileDialog::OnFileSelchanged.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnFileNameChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCmMiDeHiDgGiDeCiDgCiDgHiDhLiDgCiDeOiDfIiCkKiPeDjAlDiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnFileNameChanged ()
{
// 06.03.05 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	FFDebugTrace(L"FCDbFileDialog::OnFileNameChanged\n");
} // FCDbFileDialog::OnFileNameChanged.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnFileTypeChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiCmMiOoNjHnOiCmMiDfCiDjDiDhLiDhLiDgCiDeOiDfIiCkKjFmPiNfIiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lFilterIndex	:_xZkqqHx_jBeJjBpAjFmPiNfIiMoDiCmMiDhEiDeCiDiLiDfOiBfLiCmMiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *							 _xZkqqHx_iNmFiPiJiCmMiDhEiDeCiDiLiDfOiBfLiCmMiPoKiNiHiCmNiCePiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnFileTypeChanged (long lFilterIndex)
{
// 06.01.21 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	TRACE(_T("FCDbFileDialog::OnFileTypeChanged %d\n"), lFilterIndex);
	//----- _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCkJiCoHiBeBiKgHjCkDiOhBjGlDiClFiDhEiDeAiDeDiDiLjGlMiCmGiKgHjCkDiOhBiCpAiOoGjDlO_xHqqkZx_ -----
	WString wstrFileName;
	WString wstrExtension;
	FFSplitFileName(&wstrFileName, &wstrExtension, GetFileName());

	// _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAjChFiCkLiKlHiCkGiCoJiCkJiBeI_xHqqkZx_
	BOOL bIsReplaceExt = FALSE;
//----- 06.04.01 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	if (!wstrFileName.IsEmpty() && wstrExtension.IsEmpty())
//	//----- _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCkKjGlDiCkCiPoKiNiH_xHqqkZx_ -----
//	{
//		bIsReplaceExt = TRUE;
//	} else
//----- 06.04.01 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	if (!wstrFileName.IsEmpty())
	//----- _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCkKjHeMiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCmMiDhEiDeCiDiLiDfOiBfLiCmGiBeBiNkBjBeJjBpAiClDiCoKiCmEiCkCiCoJiDhEiDeCiDiLiDfOiBfLiCkK_xHqqkZx_
		// _xZkqqHx_iIoKjChGiClFiCmIiCkCiPoKiNiHiCmNiBeBiDhEiDeAiDeDiDiLiKgHjCkDiOhBiCpAiNkBjBeJjBpAiClDiCoKiCmEiCkCiCoJiDhEiDeCiDiLiDfOiBfLiCmM_xHqqkZx_
		// _xZkqqHx_iKgHjCkDiOhBiCmJjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
		// _xZkqqHx_iDhEiDeAiDeDiDiLiKgHjCkDiOhBiCmJiIoKjChGiClHiCoJiDhEiDeCiDiLiDfOiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOoGjDlOiBeC_xHqqkZx_
		longSet stIndex;
		FindFilterFileExt(stIndex, wstrExtension);
		if (!stIndex.empty() && stIndex.find(lFilterIndex) == stIndex.end())
			bIsReplaceExt = TRUE;
	}
	if (bIsReplaceExt)
	//----- _xZkqqHx_iKgHjCkDiOhBiCpAjChFiCkLiKlHiCkGiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iMlLiNnNiCmMiDhEiDeCiDiLiDfOiCmJiIoKjChGiClHiCoJiKgHjCkDiOhBiCpAiOoGjDlOiBeC_xHqqkZx_
		GetFilterFileExt(wstrExtension, lFilterIndex);
		if (!wstrExtension.IsEmpty() && wstrExtension.Find(L'*') == -1)
		//----- _xZkqqHx_iDhEiDeCiDiLiDfOiCmMiKgHjCkDiOhBiCkKjBlGiNnNiClFiBeB_xHqqkZx_* _xZkqqHx_iCkKiOgHiCoNiCoKiCmEiCkCiCmIiCkCiPoKiNiH_xHqqkZx_ -----
		{
			// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMiCmMiDeHiDgGiDeCiDgCiDgHiDhLiDgCiDeOiDfIiCpAiPeDjAlDiBeC_xHqqkZx_
			SetFileName(wstrFileName + wstrExtension);
//----- 05.10.12 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//			// _xZkqqHx_iDeHiDgGiDeCiDgCiDgHiDhLiDgCiDeOiDfIiPeDjAlDiCmMjCmKjCgNiPiIjHjNiBeC_xHqqkZx_
//			OnFileNameChanged();
//----- 05.10.12 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
		}
	}
} // FCDbFileDialog::OnFileTypeChanged.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnFolderChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeIiDiLiDfPiCkKjFmPiNfIiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.14 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::OnFolderChanged ()
{
// 06.01.21 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	TRACE(_T("FCDbFileDialog::OnFolderChanged\n"));
} // FCDbFileDialog::OnFolderChanged.

//----- 06.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetDlgItem
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	
// *
// * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	
// *
// * <_xZkqqHx_jCiNiInD_xHqqkZx_>	
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//CWnd* FCDbFileDialog::GetDlgItem (int nID) const
//{
//	return CWnd::FromHandle(GetDlgItem(m_hWnd, nID));
//} // FCDbFileDialog::GetDlgItem.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetParent
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	
// *
// * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	
// *
// * <_xZkqqHx_jCiNiInD_xHqqkZx_>	
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//CWnd* FCDbFileDialog::GetParent () const
//{
//	return CWnd::FromHandle(TwGetHwnd());
//} // FCDbFileDialog::GetParent.
//----- 06.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::TwGetHwnd
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	TopDialogWindow _xZkqqHx_iCmM_xHqqkZx_HWND_xZkqqHx_iCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDeFiDeCiDjDiDgIiDeFiDgOiDjDiDgIiDiLiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iPoDiCmMiBhFiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiNfMjBkCiBhGiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
HWND FCDbFileDialog::TwGetHwnd () const
{
	return ::GetParent(m_hWnd);
} // FCDbFileDialog::TwGetHwnd.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::TwGetDlgItemHwnd
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	TopDialogWindow _xZkqqHx_iJlKiCmMiDfCiDjDiDgHiDiNiBfLiDiLiCmM_xHqqkZx_HWND_xZkqqHx_iCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nId	:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiL_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDeFiDeCiDjDiDgIiDeFiDgOiDjDiDgIiDiLiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iPoDiCmMiBhFiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiNfMjBkCiBhGiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
HWND FCDbFileDialog::TwGetDlgItemHwnd (int nId) const
{
	return ::GetDlgItem(TwGetHwnd(), nId);
} // FCDbFileDialog::TwGetDlgItemHwnd.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::TwPostMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	TopDialogWindow _xZkqqHx_iCmJjBmOiClFiCmE_xHqqkZx_PostMessage_xZkqqHx_iClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwMessageId	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiMiLiJmKiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iPoDiCmMiBhFiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiNfMjBkCiBhGiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCDbFileDialog::TwPostMessage (DWORD dwMessageId, WPARAM wParam, LPARAM lParam) const
{
	return ::PostMessage(TwGetHwnd(), dwMessageId, wParam, lParam);
} // FCDbFileDialog::TwPostMessage.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::TwSendMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	TopDialogWindow _xZkqqHx_iCmJjBmOiClFiCmE_xHqqkZx_SendMessage_xZkqqHx_iClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwMessageId	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam		:_xZkqqHx_iDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiMiLiJmKiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iPoDiCmMiBhFiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiNfMjBkCiBhGiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
LRESULT FCDbFileDialog::TwSendMessage (DWORD dwMessageId, WPARAM wParam, LPARAM lParam) const
{
	return ::SendMessage(TwGetHwnd(), dwMessageId, wParam, lParam);
} // FCDbFileDialog::TwSendMessage.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::TwScreenToClient
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiCmMiDfIiDeOiDiKiBfLiDjDiNmAjFfHjCgMiCpA_xHqqkZx_ TopDialogWindow _xZkqqHx_iCmMiDeOiDiJiDeDiDeBiDjDiDgHiNmAjFfHiCmJ_xHqqkZx_
 *			_xZkqqHx_jFmPiKlHiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpPoint		:_xZkqqHx_jFmPiKlHiClHiCoJiNmAjFfHiCpAiOhHjCoIiBeCjFmPiKlHjCgMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iPoDiCmMiBhFiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiNfMjBkCiBhGiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::TwScreenToClient (LPPOINT lpPoint) const
{
	::ScreenToClient(TwGetHwnd(), lpPoint);
} // FCDbFileDialog::TwScreenToClient.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::TwScreenToClient
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiCmMiDfIiDeOiDiKiBfLiDjDiNmAjFfHjCgMiCpA_xHqqkZx_ TopDialogWindow _xZkqqHx_iCmMiDeOiDiJiDeDiDeBiDjDiDgHiNmAjFfHiCmJ_xHqqkZx_
 *			_xZkqqHx_jFmPiKlHiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	lpRect		:_xZkqqHx_jFmPiKlHiClHiCoJiNmAjFfHiCpAiOhHjCoIiBeCjFmPiKlHjCgMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iPoDiCmMiBhFiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiNfMjBkCiBhGiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCDbFileDialog::TwScreenToClient (LPRECT lpRect) const
{
	POINT ptTopLeft = { lpRect->left, lpRect->top };
	POINT ptBottomRight = { lpRect->right, lpRect->bottom };
	::ScreenToClient(TwGetHwnd(), &ptTopLeft);
	::ScreenToClient(TwGetHwnd(), &ptBottomRight);
	lpRect->left = ptTopLeft.x;
	lpRect->top = ptTopLeft.y;
	lpRect->right = ptBottomRight.x;
	lpRect->bottom = ptBottomRight.y;
} // FCDbFileDialog::TwScreenToClient.

//----- 06.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::DDXControl
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	MFC_xZkqqHx_iCmM_xHqqkZx_DDX_Control_xZkqqHx_iKnGjAjEiCmGjDkPjHgMiBeCiDfCiDjDiDgHiDiNiBfLiDiLiCpAjChFiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwControlId	:_xZkqqHx_jChFiCkLiKlHiCkGiCoJiDfCiDjDiDgHiDiNiBfLiDiLiCmM_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
// *			wndControl	:_xZkqqHx_jChFiCkLiKlHiCkGiCoJjAoGiCmMiDfCiDjDiDgHiDiNiBfLiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCDbFileDialog::DDXControl (DWORD dwControlId, CWnd& wndControl)
//{
//	// MFC_xZkqqHx_iCmM_xHqqkZx_DDX_Control_xZkqqHx_iKnGjAjEiCpAiOfBiPmGiBeC_xHqqkZx_
//	if (wndControl.m_hWnd == NULL)
//	//----- not subclassed yet -----
//	{
//		HWND hWndCtrl = ::GetDlgItem(m_hWnd, dwControlId);
//		if (!wndControl.SubclassWindow(hWndCtrl))
//		{
//			ASSERT(FALSE);      // possibly trying to subclass twice?
//			AfxThrowNotSupportedException();
//		}
////----- 05.10.13 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
////		else
////		{
////			// If the control has reparented itself (e.g., invisible control),
////			// make sure that the CWnd gets properly wired to its control site.
////			if (m_hWnd != ::GetParent(wndControl.m_hWnd))
////				wndControl.AttachControlSite(CWnd::FromHandle(m_hWnd));
////		}
////----- 05.10.13 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//	}
//} // FCDbFileDialog::DDXControl.
//----- 06.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmJjBjHiCoHiCoKiClNiDiBiDgCiDfKiBfLiDfHiCpAiPiIjHjNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwMessageId	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iClBiCmMiKnGjAjEiCmFiPiIjHjNiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiBeBiPiIjHjNiCmFiCkLiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ 0_xZkqqHx_iBeC_xHqqkZx_
 *			0 _xZkqqHx_iCpAjFnEiClFiClNiPoKiNiHiCmNiBeBiDgGiDhEiDeIiDiLiDgHiCmMiPiIjHjNiCkKiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
UINT_PTR FCDbFileDialog::OnMessage (DWORD dwMessageId, WPARAM wParam, LPARAM lParam)
{
	FFDebugTrace(L"FCDbFileDialog::OnMessage %x %x %x\n", dwMessageId, wParam, lParam);
	switch (dwMessageId)
	{
	case WM_INITDIALOG:
		// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiCmJiOlIjEhDiClFiClNiPoKiNiHiCmNiBeBiDfPiDeDiDeBiDiNiDePiCpAiPeJjHlJiBeC_xHqqkZx_
		// _xZkqqHx_iDeJiDjDiDiJiDeDiDjDiDhNiDgKiDiFiDeBiDiLiCmFiCmNiBeB_xHqqkZx_IDABORT_xZkqqHx_iCpAjBjHiCoK_xHqqkZx_ _xZkqqHx_iCmGiPjBiCkCiCmEiCkAiCoJiCkKiBeB_xHqqkZx_
		// IDABORT _xZkqqHx_iCpAjBjHiCmBiClNiCmBiCmEjFmCiClGiCoCiClFiCmIiCkCiBeC_xHqqkZx_
		if (!OnInitDialog())
			TwPostMessage(WM_CLOSE, 0L, 0L);
		break;
	case WM_DESTROY:
		OnDestroy();
		break;
	case WM_NOTIFY:
	  {
		LPNMHDR pnmh = (LPNMHDR)lParam;
// 06.01.21 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//		TRACE(_T("FCDbFileDialog::OnMessage WM_NOTIFY %x\n"), pnmh->code);
		switch (pnmh->code)
		{
		case CDN_FILEOK:		// OK_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiBeC_xHqqkZx_
			OnOK();
			break;
		case CDN_HELP:			// HELP_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiBeC_xHqqkZx_
			OnHelp();
			break;
		case CDN_SELCHANGE:		// _xZkqqHx_iDhEiDeAiDeDiDiLjBeJjBpAjFmPiNfIiCkJiCoHiBeC_xHqqkZx_
			OnFileSelchanged();
			break;
		case CDN_TYPECHANGE:	// _xZkqqHx_iDhEiDeAiDeDiDiLiOoNjHnOjFmPiNfIiCkJiCoHiBeC_xHqqkZx_
			// _xZkqqHx_iDhEiDeAiDeDiDiLiOoNjHnOiCmMiDfCiDjDiDhLiDhLiDgCiDeOiDfIiCpAjFmPiNfIiClHiCoJiCmGiBeBiClBiClBiCkKiCfBiJpBiMmEiCmOiCoKiCoJiCmMiCmFiBeB_xHqqkZx_
			// _xZkqqHx_jBePiJpBiCmMjCgMiCpAiDgAiDeGiDgCiDeOiClHiCoJjFeLjHhGiCkKiCkAiCoJiBeC_xHqqkZx_
			if (m_lLastFilterIndex != m_ofn.nFilterIndex)
			//----- _xZkqqHx_jBePiJpBiCmGiDhEiDeCiDiLiDfOiBfLiDeDiDjDiDgGiDgCiDeOiDfIiCkKiInJiCmIiCoJiPoKiNiH_xHqqkZx_ -----
			{
				OnFileTypeChanged(m_ofn.nFilterIndex - 1);
				m_lLastFilterIndex = m_ofn.nFilterIndex;
			}
			break;
		case CDN_FOLDERCHANGE:	// _xZkqqHx_iDhEiDeIiDiLiDfPjFmPiNfIiCkJiCoHiBeC_xHqqkZx_
			OnFolderChanged();
			break;
		default:
			return 0;
		}
		break;
	  }
	case WM_SIZE:
		OnSize(wParam, LOWORD(lParam), HIWORD(lParam));
		break;
	case WM_CTLCOLORBTN:
	  {
		// _xZkqqHx_iDhLiDfOiDjD_xHqqkZx_ _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiBeC_xHqqkZx_
		HBRUSH hb = OnCtlColor(HDC(wParam), HWND(lParam), CTLCOLOR_BTN);
		return UINT_PTR(hb);
	  }
	case WM_CTLCOLOREDIT:
	  {
		// _xZkqqHx_iDeHiDgGiDeCiDgCiDgH_xHqqkZx_ _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiBeC_xHqqkZx_
		HBRUSH hb = OnCtlColor(HDC(wParam), HWND(lParam), CTLCOLOR_EDIT);
		return UINT_PTR(hb);
	  }
	case WM_CTLCOLORDLG:
	  {
		// _xZkqqHx_iDfPiDeDiDeBiDiNiDeP_xHqqkZx_ _xZkqqHx_iDhLiDgCiDeOiDfIiBeC_xHqqkZx_
		HBRUSH hb = OnCtlColor(HDC(wParam), HWND(lParam), CTLCOLOR_DLG);
		return UINT_PTR(hb);
	  }
	case WM_CTLCOLORLISTBOX:
	  {
		// _xZkqqHx_iDiKiDfIiDgH_xHqqkZx_ _xZkqqHx_iDhLiDgCiDeOiDfI_xHqqkZx_ _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiBeC_xHqqkZx_
		HBRUSH hb = OnCtlColor(HDC(wParam), HWND(lParam), CTLCOLOR_LISTBOX);
		return UINT_PTR(hb);
	  }
	case WM_CTLCOLORSCROLLBAR:
	  {
		// _xZkqqHx_iDfIiDeOiDiNiBfLiDiL_xHqqkZx_ _xZkqqHx_iDgPiBfL_xHqqkZx_ _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiBeC_xHqqkZx_
		HBRUSH hb = OnCtlColor(HDC(wParam), HWND(lParam), CTLCOLOR_SCROLLBAR);
		return UINT_PTR(hb);
	  }
	case WM_CTLCOLORSTATIC:
	  {
		// _xZkqqHx_jAmDjDeJiDfCiDjDiDgHiDiNiBfLiDiLiBeC_xHqqkZx_
		HBRUSH hb = OnCtlColor(HDC(wParam), HWND(lParam), CTLCOLOR_STATIC);
		return UINT_PTR(hb);
	  }
	case WM_COMMAND:
		return UINT_PTR(OnCommand(wParam, lParam));

	default:
		return 0;
	}
	return 1;
} // FCDbFileDialog::OnMessage.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OnCommand
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	WM_COMMAND_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCpAiPiIjHjNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iClBiCmMiKnGjAjEiCmFiPiIjHjNiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBiPiIjHjNiCmFiCkLiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCDbFileDialog::OnCommand (WPARAM wParam, LPARAM lParam)
{
	FFDebugTrace(L"OnCommand %x %x\n", HIWORD(wParam), LOWORD(wParam));
	if (HIWORD(wParam) == EN_CHANGE &&
		LOWORD(wParam) == edt1)
	{
		// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMjFmPiNfIiCpAjCmKjCgNiBeCjCmKjCgNiDiBiDgCiDfKiBfLiDfHiCmIiCmMiCmF_xHqqkZx_CallWindowProc_xZkqqHx_iCmMiMoDiCmJiOmAiNhDiClHiCoJiCnJiCkEiCkKiCkCiCkCiBeC_xHqqkZx_
		OnFileNameChanged();
		return TRUE;
	}
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	if (wParam == FD_DBFD_OK_BUTTON_ID)
//	//----- _xZkqqHx_jBoDjHjNiCgOiCgKiDhLiDfOiDjDiCmMiPoKiNiH_xHqqkZx_ -----
//	{
////----- 06.04.20 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
////		// IDOK_xZkqqHx_iCpAjBjHjFhEiBeC_xHqqkZx_
////		TwPostMessage(WM_COMMAND, IDOK, 0);
////----- 06.04.20 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
//		// _xZkqqHx_iDeOiDiKiDgCiDeOiClFiClNiNmAjFfHiCpAiCfEiBeDiCfEiCmGiClHiCoJiBeC_xHqqkZx_
//		POINTS pnt = {5, 5};
//		LPARAM lParam = *((LPARAM*)&pnt);
//		::SendMessage(TwGetDlgItemHwnd(IDOK), WM_LBUTTONDOWN, 0, lParam);
//		::SendMessage(TwGetDlgItemHwnd(IDOK), WM_LBUTTONUP, 0, lParam);
////----- 06.04.20 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
//	}
//----- 06.04.20 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	return FALSE;
} // FCDbFileDialog::OnCommand.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetCurrentMessage
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMlLiNnNiPiIjHjNjCiGiCmMiDiBiDgCiDfKiBfLiDfHiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	OnMessage_xZkqqHx_iCmFiPiIjHjNjCiGiCmMiPoKiNiHiCmMiCnNjHeMiMpIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const MSG* FCDbFileDialog::GetCurrentMessage () const
{
	return &m_msgLastMessage;
} // FCDbFileDialog::GetCurrentMessage.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::GetControlText
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgFiDeMiDfIiDgHiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwId	:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiL_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDgFiDeMiDfIiDgHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
WString FCDbFileDialog::GetControlText (DWORD dwId) const
{
	map<DWORD, WString>::const_iterator i = m_mpIdToText.find(dwId);
	if (i != m_mpIdToText.end())
		return i->second;
	switch (dwId)
	{
	case stc2:		// _xZkqqHx_iDhEiDeAiDeDiDiLiCmMiOoNjHnO_xHqqkZx_(&X):
		return FFLoadWString(IDS_CTRL_FILE_KIND);
	case stc3:		// _xZkqqHx_iDhEiDeAiDeDiDiLjGlM_xHqqkZx_(&W):
		return FFLoadWString(IDS_CTRL_FILE_NAME);
	case IDCANCEL:	// _xZkqqHx_iDeMiDiDiDjDiDfKiDiL_xHqqkZx_(&Q)
		return FFLoadWString(IDS_CTRL_CANCEL);
	case psh15:		// Help (&1)
		return FFLoadWString(IDS_CTRL_HELP);
	case stc4:		// _xZkqqHx_iDhEiDeAiDeDiDiLiCmMiPoKiPiK_xHqqkZx_(&E):
		if (m_bOpenFileDialog)
			return FFLoadWString(IDS_CTRL_FILE_OPEN_DRIVE);
		else
			return FFLoadWString(IDS_CTRL_FILE_SAVE_DRIVE);
// 06.04.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	case FD_DBFD_OK_BUTTON_ID:	// _xZkqqHx_iKeKiCkN_xHqqkZx_ (&T)
	case IDOK:					// _xZkqqHx_iKeKiCkN_xHqqkZx_ (&T)
		if (m_bOpenFileDialog)
			return FFLoadWString(IDS_CTRL_OPEN);
		else
			return FFLoadWString(IDS_CTRL_SAVE);
	default:
		return WString();
	}
} // FCDbFileDialog::GetControlText.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::OFNHookProc
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCmJiDhEiDgCiDeOiClHiCoJiDfCiBfLiDiLiDgPiDgCiDeOiKnGjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	hdlg	:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiDeFiDeCiDjDiDgIiDeFiCmMiDgOiDjDiDgIiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
 *			uiMsg	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDhAiDiJiDiBiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iClBiCmMiKnGjAjEiCmFiPiIjHjNiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_ 0 _xZkqqHx_iImIiKePiBeBiPiIjHjNiCmFiCkLiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ 0_xZkqqHx_iBeC_xHqqkZx_
 *			0 _xZkqqHx_iCpAjFnEiClFiClNiPoKiNiHiCmNiBeBiDgGiDhEiDeIiDiLiDgHiCmMiPiIjHjNiCkKiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
UINT_PTR CALLBACK FCDbFileDialog::OFNHookProc (	HWND hdlg,
												UINT uiMsg,
												WPARAM wParam,
												LPARAM lParam)
{
//----- 05.10.12 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	TRACE(_T("FCDbFileDialog::OFNHookProc %x %x %x %x %x\n"), hdlg, ::GetParent(hdlg), uiMsg, wParam, lParam);
//	switch (uiMsg)
//	{
//	case WM_INITDIALOG:
//	  {
//		LPOPENFILENAME lpOFN = LPOPENFILENAME(lParam);
//		FCDbFileDialog* pDlg = (FCDbFileDialog*)lpOFN->lCustData;
//		pDlg->m_hWnd = hdlg;
//		if (!pDlg->OnInitDialog())
//		//----- _xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiCmJiOlIjEhDiClFiClNiPoKiNiH_xHqqkZx_ -----
//		{
//			// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCpAiPeJjHlJiBeC_xHqqkZx_
//			PostMessage(hdlg, WM_COMMAND, WPARAM(IDABORT), 0);
//		}
//		return TRUE;
//	  }
//	case WM_DESTROY:
//	  {
//		// _xZkqqHx_iDeFiDeCiDjDiDgIiDeF_xHqqkZx_->FCDbFileDialog_xZkqqHx_iDgFiBfLiDhFiDiLiCkJiCoHiDfPiDeDiDeBiDiNiDePiCpAiMjPiNpFiBeC_xHqqkZx_
//		FCDbFileDialog* pDlg = FCDbFileDialog::myHWNDToDlgTable(findDlg, ::GetParent(hdlg), NULL);
//		pDlg->OnDestroy();
//		break;
//	  }
//	case WM_NOTIFY:
//	  {
//		LPNMHDR pnmh = (LPNMHDR)lParam;
//		switch (pnmh->code)
//		{
//		case CDN_FILEOK:		// OK_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiBeC_xHqqkZx_
//		  {
//			LPOFNOTIFY lpOfNotify = (LPOFNOTIFY)lParam;
//			FCDbFileDialog* pDlg = (FCDbFileDialog*)lpOfNotify->lpOFN->lCustData;
//
//			_TCHAR sz[5000];
//			sz[0] = 0;
//			long len = ::SendMessage(hdlg, CDM_GETSPEC, (WPARAM)100, (LPARAM)sz);
//
//
//			AfxDebugBreak();
//			break;
//		  }
//		case CDN_HELP:			// HELP_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiBeC_xHqqkZx_
//		  {
//			LPOFNOTIFY lpOfNotify = (LPOFNOTIFY)lParam;
//			FCDbFileDialog* pDlg = (FCDbFileDialog*)lpOfNotify->lpOFN->lCustData;
//			pDlg->OnHelp();
//			break;
//		  }
//		case CDN_SELCHANGE:		// _xZkqqHx_iDhEiDeAiDeDiDiLjBeJjBpAjFmPiNfIiCkJiCoHiBeC_xHqqkZx_
//		  {
//			LPOFNOTIFY lpOfNotify = (LPOFNOTIFY)lParam;
//			FCDbFileDialog* pDlg = (FCDbFileDialog*)lpOfNotify->lpOFN->lCustData;
//			pDlg->OnFileSelchanged();
//			break;
//		  }
//		case CDN_TYPECHANGE:	// _xZkqqHx_iDhEiDeAiDeDiDiLiOoNjHnOjFmPiNfIiCkJiCoHiBeC_xHqqkZx_
//		  {
//			LPOFNOTIFY lpOfNotify = (LPOFNOTIFY)lParam;
//			FCDbFileDialog* pDlg = (FCDbFileDialog*)lpOfNotify->lpOFN->lCustData;
//			pDlg->OnFileTypeChanged(long(lpOfNotify->lpOFN->nFilterIndex) - 1);
//			break;
//		  }
//
//
//		}
//		break;
//	  }
//	case WM_COMMAND:
//		AfxDebugBreak();
//		break;
//	}
//	return 0;
//----- 05.10.12 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
// 06.01.21 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	TRACE(_T("FCDbFileDialog::OFNHookProc %x %x %x %x %x\n"), hdlg, ::GetParent(hdlg), uiMsg, wParam, lParam);
#ifdef _DEBUG
//	FFDebugTrace(L"FCDbFileDialog::OFNHookProc %x %x %x\n", uiMsg, wParam, lParam);
#endif

	if (uiMsg == WM_INITDIALOG)
	//----- _xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiDiBiDgCiDfKiBfLiDfHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		LPOPENFILENAME lpOFN = LPOPENFILENAME(lParam);
		FCDbFileDialog* pDlg = (FCDbFileDialog*)lpOFN->lCustData;
		pDlg->m_hWnd = hdlg;
		// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiCpAjDpMiCoKjBnGiCkGiCoJiBeC_xHqqkZx_
		pDlg->m_parentProc = DLGPROC(GetWindowLong(::GetParent(pDlg->m_hWnd), DWL_DLGPROC));
		SetWindowLong(::GetParent(pDlg->m_hWnd), DWL_DLGPROC, long(myDlgParentProc));
		// _xZkqqHx_iDeFiDeCiDjDiDgIiDeF_xHqqkZx_->FCDbFileDialog_xZkqqHx_iDgFiBfLiDhFiDiLiCmJjDgPjIfOiBeC_xHqqkZx_
		myHWNDToDlgTable(registerDlg, ::GetParent(hdlg), pDlg);
	}

	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiPiIjHjNiBeC_xHqqkZx_
	UINT_PTR dwReturn = 0;
	// _xZkqqHx_iDeFiDeCiDjDiDgIiDeF_xHqqkZx_->FCDbFileDialog_xZkqqHx_iDgFiBfLiDhFiDiLiCkJiCoHiDfPiDeDiDeBiDiNiDePiCpAiMjPiNpFiBeC_xHqqkZx_
	FCDbFileDialog* pDlg = FCDbFileDialog::myHWNDToDlgTable(findDlg, ::GetParent(hdlg), NULL);
	if (pDlg != NULL)
	{
		pDlg->m_msgLastMessage.hwnd = hdlg;
		pDlg->m_msgLastMessage.message = uiMsg;
		pDlg->m_msgLastMessage.wParam = wParam;
		pDlg->m_msgLastMessage.lParam = lParam;
		dwReturn = pDlg->OnMessage(uiMsg, wParam, lParam);
	}

	if (uiMsg == WM_DESTROY)
	//----- _xZkqqHx_iDfPiDeDiDeBiDiNiDePiPeJjHlJiDiBiDgCiDfKiBfLiDfHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jGhLjHiIiCmMiDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiCmJjGnPiClHiBeC_xHqqkZx_
		SetWindowLong(::GetParent(pDlg->m_hWnd), DWL_DLGPROC, long(pDlg->m_parentProc));
		pDlg->m_parentProc = NULL;
		// _xZkqqHx_iDeFiDeCiDjDiDgIiDeF_xHqqkZx_->FCDbFileDialog_xZkqqHx_iDgFiBfLiDhFiDiLiCmMjDgPjIfOjGjFiPmBiBeC_xHqqkZx_
		myHWNDToDlgTable(crossOffDlg, ::GetParent(pDlg->m_hWnd), NULL);
		// _xZkqqHx_iDeFiDeCiDjDiDgIiDeFjFmPjAjEiCpAiDeOiDiKiDeBiBeC_xHqqkZx_
		pDlg->m_hWnd = NULL;
	}
	return dwReturn;
//----- 05.10.12 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
} // FCDbFileDialog::OFNHookProc.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::myDlgParentProc
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iMlLiNnNiCmMjAgFiDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiCmGjChFiCkLiKlHiCkGiCoJiClNiCnPiCmMiKnGjAjEiBeC_xHqqkZx_
 *			_xZkqqHx_iDhEiDeCiDiLiDfOiDfCiDjDiDhLiDhLiDgCiDeOiDfIjFmPiNfIiCmMiPoKiNiHiCmMiPiIjHjNiCpAiNhDiCkEiBeC_xHqqkZx_
 *			_xZkqqHx_jDoAjFjEiCmFiCmNiBeBiMlDiBfIiCmMiDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiCpAiMmEiCnBiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
INT_PTR CALLBACK FCDbFileDialog::myDlgParentProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	// _xZkqqHx_iDeFiDeCiDjDiDgIiDeF_xHqqkZx_->FCDbFileDialog_xZkqqHx_iDgFiBfLiDhFiDiLiCkJiCoHiDfPiDeDiDeBiDiNiDePiCpAiMjPiNpFiBeC_xHqqkZx_
	FCDbFileDialog* pDlg = FCDbFileDialog::myHWNDToDlgTable(findDlg, hWnd, NULL);
#ifdef _DEBUG
//	FFDebugTrace(L"myDlgParentProc %x %x %x %x %x\n",pDlg,hWnd,message,wParam,lParam);
#endif

//	TRACE("myDlgParentProc %x %x %x %x %x\n",pDlg,hWnd,message,wParam,lParam);
//----- 05.10.12 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	if (message == WM_COMMAND &&
//		HIWORD(wParam) == EN_CHANGE &&
//		LOWORD(wParam) == edt1)
//	{
//		pDlg->OnFileNameChanged();
//	}
//	// _xZkqqHx_jGhLjHiIiCmMiDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiCpAiOmAiNhDiBeC_xHqqkZx_
//	return CallWindowProc(WNDPROC(pDlg->m_parentProc), hWnd, message, wParam, lParam);
//----- 05.10.12 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_jGhLjHiIiCmMiDfPiDeDiDeBiDiNiDePiDhGiDiNiDfGiDfHiDiDiCpAiOmAiNhDiBeC_xHqqkZx_
	INT_PTR iptr = CallWindowProc(WNDPROC(pDlg->m_parentProc), hWnd, message, wParam, lParam);
//----- 06.01.22 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	if (message == WM_COMMAND &&
//		HIWORD(wParam) == EN_CHANGE &&
//		LOWORD(wParam) == edt1)
//	{
//		// _xZkqqHx_iDhEiDeAiDeDiDiLjGlMjFmPiNfIiCpAjCmKjCgNiBeCjCmKjCgNiDiBiDgCiDfKiBfLiDfHiCmIiCmMiCmF_xHqqkZx_CallWindowProc_xZkqqHx_iCmMiMoDiCmJiOmAiNhDiClHiCoJiCnJiCkEiCkKiCkCiCkCiBeC_xHqqkZx_
//		pDlg->OnFileNameChanged();
//	} else
//	if (message == WM_SIZE)
//	{
//		pDlg->m_msgLastMessage.hwnd = hWnd;
//		pDlg->m_msgLastMessage.message = message;
//		pDlg->m_msgLastMessage.wParam = wParam;
//		pDlg->m_msgLastMessage.lParam = lParam;
//		pDlg->OnMessage(message, wParam, lParam);
//	}
//----- 06.01.22 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	switch (message)
	{
	case WM_COMMAND:
	case WM_SIZE:
	  {
		pDlg->m_msgLastMessage.hwnd = hWnd;
		pDlg->m_msgLastMessage.message = message;
		pDlg->m_msgLastMessage.wParam = wParam;
		pDlg->m_msgLastMessage.lParam = lParam;
		pDlg->OnMessage(message, wParam, lParam);
		break;
	  }
//----- 06.04.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	case WM_CTLCOLORBTN:
	  {
		// IDOK_xZkqqHx_iCmNjChFiKlHiClFiCmEiCoAjGlDjBmKiBeCiDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCmNiBeBiJlNiCkJiDeDiDhIiDjDiDgHiCmMjDhIiCmJ_xHqqkZx_
		// IDOK_xZkqqHx_iCpAiPjBiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
		// _xZkqqHx_jFnLjBlGiDfPiDeDiDeBiDiNiDePiCmFiCoA_xHqqkZx_ _xZkqqHx_iDgGiDeCiDiMiDeOiDgHiDiKjBeJjBpAiOjOiCmNiBhFiKeKiCkNiBhGiCmJiBeBjBeJjBpAiClFiCmEiCkCiCmIiCkC_xHqqkZx_
		// _xZkqqHx_iCmGiCkLiCmNiBhFjFnLjBlGiBhGiCmJjFmPiNfIiClHiCoJiClNiCnPiBeC_xHqqkZx_

		HWND hwndOK = pDlg->TwGetDlgItemHwnd(IDOK);
		if (hwndOK == HWND(lParam))
		//----- IDOK_xZkqqHx_iCmMjAeGiOoGjDlOiCmMiPoKiNiH_xHqqkZx_ -----
		{
			WString wstrNewText = pDlg->GetControlText(IDOK);
			WString wstrOldText;
			FFGetWindowText(hwndOK, wstrOldText, CP_ACP);
			if (wstrNewText != wstrOldText)
				FFSetWindowText(hwndOK, wstrNewText, CP_ACP);
		}
		break;
	  }
//----- 06.04.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	}
//----- 06.01.22 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

	return iptr;
//----- 05.10.12 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
} // FCDbFileDialog::myDlgParentProc.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDbFileDialog::myHWNDToDlgTable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	HWND -> _xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCnGiCmMiDgFiBfLiDhFiDiLiCpAiKmHjHjNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nCmd	:_xZkqqHx_iLeAjEfMiCpAiOhHjCoIiClHiCoJiBeC_xHqqkZx_
 *				registerDlg	_xZkqqHx_jDgPjIfOiPiIjHjNiBeC_xHqqkZx_
 *				crossOffDlg	_xZkqqHx_jDgPjIfOjGjFiPmBiPiIjHjNiBeC_xHqqkZx_
 *				findDlg		_xZkqqHx_iMjPiNpFiPiIjHjNiBeC_xHqqkZx_
 *			hWnd	:_xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pDlg	:_xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	myDlgParentProc _xZkqqHx_iCmJiCkIiCkCiCmEiBeB_xHqqkZx_HWND _xZkqqHx_iCkJiCoH_xHqqkZx_ FCDbFileDialog _xZkqqHx_iCpAiMkJiCmCiCkPiCoJ_xHqqkZx_
 *			_xZkqqHx_jFpLjGeAiCkKjGlDiCkCiClNiCnPiBeBiClBiCmMiKnGjAjEiCmFiMjPiNpFiCmFiCkLiCoJiCoGiCkEiCmJiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCDbFileDialog* FCDbFileDialog::myHWNDToDlgTable (short nCmd, HWND hWnd, FCDbFileDialog* pDlg)
{
	// mpHwndToDlg _xZkqqHx_iCmJiDeBiDeOiDfKiDfIiClHiCoJiClNiCnPiCmM_xHqqkZx_ CriticalSection _xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
	static FCAutoDeleteCriticalSection csAuto;
	// HWND -> _xZkqqHx_iDhEiDeAiDeDiDiLiDfPiDeDiDeBiDiNiDePiCnGiCmMiDgFiBfLiDhFiDiLiBeC_xHqqkZx_
	static map<HWND, FCDbFileDialog*> mpHwndToDlg;
	// _xZkqqHx_jFnEiClHjCgMiBeC_xHqqkZx_
	FCDbFileDialog* pValue = NULL;

	// CriticalSection _xZkqqHx_iCmJjDpMiOlKiBeC_xHqqkZx_
	FCAutoLeaveCriticalSection atlcs(csAuto);

	switch (nCmd)
	{
	case registerDlg:	// _xZkqqHx_jDgPjIfOiPiIjHjNiBeC_xHqqkZx_
		mpHwndToDlg[hWnd] = pDlg;
		break;
	case crossOffDlg:	// _xZkqqHx_jDgPjIfOjGjFiPmBiPiIjHjNiBeC_xHqqkZx_
		mpHwndToDlg.erase(hWnd);
		break;
	case findDlg:		// _xZkqqHx_iMjPiNpFiPiIjHjNiBeC_xHqqkZx_
		map<HWND, FCDbFileDialog*>::const_iterator i = mpHwndToDlg.find(hWnd);
		if (i != mpHwndToDlg.end())
			pValue = (*i).second;
		break;
	}
	return pValue;
} // FCDbFileDialog::myHWNDToDlgTable.

