Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cFileDirDlg.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cFileDirDlg_H
7 #define _INC_cFileDirDlg_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../GrayLibBase.h"
14 
15 #if defined(_WIN32) && (_MSC_VER >= 1300) && ! defined(UNDER_CE)
16 #include "../WinAPI/WinTypes.h"
17 typedef WORD FILEOP_FLAGS; // FOF_ALLOWUNDO, NOTE: FILEOP_FLAGS is defined in <shlobj.h>
18 
19 namespace GrayLib
20 {
21  class GRAYLIB_LINK cFileDirDlg // cWindow
22  {
27 
28  public:
29  FILECHAR_t m_szDir[_MAX_PATH]; // in/out param. Must be TCHAR to use the message macros
30  private:
31  // Input Params.
32  HWND m_hWndOwner;
33  HWND m_hWndDlg;
34  protected:
35  static int CALLBACK BrowseCallbackProc(HWND hWnd, WINMSG_t uMsg, LPARAM lParam, LPARAM lpData);
36  public:
37  cFileDirDlg(HWND hWndOwner, const FILECHAR_t* pszDir);
38  ~cFileDirDlg();
39 
40  HRESULT DoModal(const FILECHAR_t* pszPrompt);
41  static HRESULT GRAYCALL DirFileOp(FILEOP_TYPE eOp, const FILECHAR_t* pszSrc, const FILECHAR_t* pszDst, FILEOP_FLAGS nFlags, const FILECHAR_t* pszTitle = nullptr);
42  static HRESULT GRAYCALL DeleteDirFiles(const FILECHAR_t* pszPath, FILEOP_FLAGS nFlags); // allow recursive delete.
43 #ifndef UNDER_CE
44  static HRESULT GRAYCALL CreateDirectoryX(const FILECHAR_t* pszDir, HWND hWnd);
45  static HRESULT GRAYCALL SetFolderIcon(const FILECHAR_t* pszDir, const FILECHAR_t* pszSrc, DWORD dwIconIndex = 0);
46 #endif
47  };
48 };
49 #endif // _WIN32
50 #endif // _INC_cFileDirDlg_H
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define _MAX_PATH
Definition: SysTypes.h:423
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
UINT WINMSG_t
Supplement _WIN32 "windows.h".
Definition: WinTypes.h:111
Definition: cMesh.h:22
char FILECHAR_t
a UTF8 char in a file name. like TCHAR
Definition: FileName.h:22
FILEOP_TYPE
Definition: FileName.h:29