/* * $Id$ * Copyright (C) 2011 gingko - http://gingko.homeip.net/ * * This file is part of Pouchin TV Mod, a free DVB-T viewer. * See http://www.pouchintv.fr/ for updates. * * Pouchin TV Mod is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Pouchin TV Mod is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include #include /// Retourner le nom de fichier spécifié avec une nouvelle extension tstring ChangeExtension(LPCTSTR pszPathName, LPCTSTR pszExtension); class CFileNameDialogBase { protected: HWND hDlg; private: /// Fonction "OFNHookProc" non statique /// Voir http://msdn.microsoft.com/en-us/library/ms646960%28VS.85%29.aspx virtual UINT_PTR OFNHookProc(UINT uMsg, WPARAM wParam, LPARAM lParam); /// Fonction "OFNHookProc" statique /// Voir http://msdn.microsoft.com/en-us/library/ms646960%28VS.85%29.aspx static UINT_PTR CALLBACK __OFNHookProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: TCHAR szFile[MAX_PATH]; TCHAR szFileTitle[MAX_PATH]; TCHAR szSelExtension[32]; OPENFILENAME sOfn; CFileNameDialogBase(); }; class COpenFileNameDialog : public CFileNameDialogBase { public: /// Note : si pMulti != NULL, alors la sélection peut être multiple et la variable pointée contient /// le chemin de répertoire en [0] et toutes les sélections ensuite. tstring Do(HWND hWndOwner, LPCTSTR pszTitle, LPCTSTR pszFilter, LPCTSTR pszInitial, vtstring * pMulti = false); }; class CSaveFileNameDialog : public CFileNameDialogBase { /// Obtenir l'extension du Nème filtre LPCTSTR GetNumFilter(int nNum); void ChangeSaveExtension(LPCTSTR pszExtension); /// Fonction "OFNHookProc" non statique /// Voir http://msdn.microsoft.com/en-us/library/ms646960%28VS.85%29.aspx virtual UINT_PTR OFNHookProc(UINT uMsg, WPARAM wParam, LPARAM lParam); public: tstring Do(HWND hWndOwner, LPCTSTR pszTitle, LPCTSTR pszFilter, LPCTSTR pszInitial); };