openfnm.cpp
#include "openfnm.h"
CMyOpenFileName::CMyOpenFileName()
{
ZeroMemory(&m_ofn,sizeof(OPENFILENAME));
m_szFileName[0] = 0;
}
CMyOpenFileName::~CMyOpenFileName()
{
}
BOOL
CMyOpenFileName::Prompt(HINSTANCE hInst, HWND hWnd)
{
m_ofn.lStructSize = sizeof(OPENFILENAME);
m_ofn.hwndOwner = hWnd;
m_ofn.hInstance = hInst;
m_ofn.lpstrFilter = 0;
m_ofn.lpstrCustomFilter = 0;
m_ofn.nMaxCustFilter = 0;
m_ofn.nFilterIndex = 0;
m_ofn.lpstrFile = m_szFileName;
m_ofn.nMaxFile = MAX_PATH;
m_ofn.lpstrFileTitle = 0;
m_ofn.nMaxFileTitle = 0;
m_ofn.lpstrInitialDir = 0;
m_ofn.lpstrTitle = 0;
m_ofn.Flags = 0;
m_ofn.nFileOffset = 0;
m_ofn.nFileExtension = 0;
m_ofn.lpstrDefExt = 0;
m_ofn.lCustData = 0;
m_ofn.lpfnHook = 0;
m_ofn.lpTemplateName = 0;
return GetOpenFileName(&m_ofn);
}
const TCHAR*
CMyOpenFileName::FileName() const
{
return m_szFileName;
}