Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.2 KiB

  1. /****************************************************************************\
  2. *
  3. * custfile.h
  4. *
  5. * Created: William Taylor (wtaylor) 01/22/01
  6. *
  7. * MS Ratings Custom File Dialog
  8. *
  9. \****************************************************************************/
  10. #ifndef CUSTOM_FILE_H
  11. #define CUSTOM_FILE_H
  12. class CCustomFileDialog : public CFileDialog
  13. {
  14. private:
  15. BOOL m_bLocalFileCheck;
  16. public:
  17. CCustomFileDialog(
  18. BOOL bLocalFileCheck,
  19. BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs
  20. LPCTSTR lpszDefExt = NULL,
  21. LPCTSTR lpszFileName = NULL,
  22. DWORD dwFlags = OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT| OFN_PATHMUSTEXIST,
  23. LPCTSTR lpszFilter = NULL,
  24. HWND hWndParent = NULL)
  25. : CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, hWndParent),
  26. m_bLocalFileCheck( bLocalFileCheck )
  27. { }
  28. BEGIN_MSG_MAP(CCustomFileDialog)
  29. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  30. NOTIFY_CODE_HANDLER(CDN_FILEOK, OnFileOk)
  31. END_MSG_MAP()
  32. protected:
  33. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  34. LRESULT OnFileOk(int /*idCtrl*/, LPNMHDR pnmh, BOOL& bHandled);
  35. public:
  36. int DoModal(HWND hWndParent = ::GetActiveWindow( ));
  37. };
  38. #endif