Subversion Repositories DevTools

Rev

Rev 1530 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1530 dpurdie 1
// Avoid multiple include collisions.
2
#ifndef _BRWSDLG_H_
3
#define _BRWSDLG_H_
4
 
5
// Options for Flags member of OPENFILENAME.
6
#define OFN_READONLY                 0x00000001
7
#define OFN_OVERWRITEPROMPT          0x00000002
8
#define OFN_HIDEREADONLY             0x00000004
9
#define OFN_NOCHANGEDIR              0x00000008
10
#define OFN_SHOWHELP                 0x00000010
11
#define OFN_ENABLEHOOK               0x00000020
12
#define OFN_ENABLETEMPLATE           0x00000040
13
#define OFN_ENABLETEMPLATEHANDLE     0x00000080
14
#define OFN_NOVALIDATE               0x00000100
15
#define OFN_ALLOWMULTISELECT         0x00000200
16
#define OFN_EXTENSIONDIFFERENT       0x00000400
17
#define OFN_PATHMUSTEXIST            0x00000800
18
#define OFN_FILEMUSTEXIST            0x00001000
19
#define OFN_CREATEPROMPT             0x00002000
20
#define OFN_SHAREAWARE               0x00004000
21
#define OFN_NOREADONLYRETURN         0x00008000
22
#define OFN_NOTESTFILECREATE         0x00010000
23
#define OFN_NONETWORKBUTTON          0x00020000
24
#define OFN_NOLONGNAMES              0x00040000
25
#define OFN_EXPLORER                 0x00080000
26
#define OFN_NODEREFERENCELINKS       0x00100000
27
#define OFN_LONGNAMES                0x00200000
28
 
29
// CommDlgExtendedError-related defines.
30
#define CDERR_DIALOGFAILURE 0xFFFF
31
#define CDERR_DIALOGFAILURE_MSG "The file browse dialog box could not be created."
32
   // The dialog box could not be created. The common dialog box function
33
   // call to the DialogBox function failed. For example, this error occurs
34
   // if the common dialog box call specifies an invalid window handle."
35
#define CDERR_FINDRESFAILURE 0x0006
36
#define CDERR_FINDRESFAILURE_MSG "The file browse dialog box function failed to find a specified resource."
37
   // The common dialog box function failed to find a specified resource.
38
#define CDERR_INITIALIZATION 0x0002
39
#define CDERR_INITIALIZATION_MSG "The file browse dialog box function failed during initialization."
40
   // The common dialog box function failed during initialization. This error
41
   // often occurs when sufficient memory is not available.
42
#define CDERR_LOADRESFAILURE 0x0007
43
#define CDERR_LOADRESFAILURE_MSG "The file browse dialog box function failed to load a specified resource."
44
   // The common dialog box function failed to load a specified resource.
45
#define CDERR_LOADSTRFAILURE 0x0005
46
#define CDERR_LOADSTRFAILURE_MSG "The file browse dialog box function failed to load a specified string."
47
   // The common dialog box function failed to load a specified string.
48
#define CDERR_LOCKRESFAILURE 0x0008
49
#define CDERR_LOCKRESFAILURE_MSG "The file browse dialog box function failed to lock a specified resource."
50
   // The common dialog box function failed to lock a specified resource.
51
#define CDERR_MEMALLOCFAILURE 0x0009
52
#define CDERR_MEMALLOCFAILURE_MSG "The common dialog box function was unable to allocate memory for internal structures."
53
   // The common dialog box function was unable to allocate memory
54
   // for internal structures.
55
#define CDERR_MEMLOCKFAILURE 0x000A
56
#define CDERR_MEMLOCKFAILURE_MSG "The common dialog box function was unable to lock the memory associated with a handle."
57
   // The common dialog box function was unable to lock the memory associated
58
   // with a handle.
59
#define CDERR_NOHINSTANCE 0x0004
60
#define CDERR_NOHINSTANCE_MSG "The ENABLETEMPLATE flag was set, but you failed to provide a corresponding instance handle."
61
   // The ENABLETEMPLATE flag was set in the Flags member of the initialization
62
   // structure for the corresponding common dialog box, but you failed to provide
63
   // a corresponding instance handle.
64
#define CDERR_NOHOOK 0x000B
65
#define CDERR_NOHOOK_MSG "The ENABLEHOOK flag was set, but you failed to provide a pointer to a corresponding hook procedure."
66
   // The ENABLEHOOK flag was set in the Flags member of the initialization
67
   // structure for the corresponding common dialog box, but you failed to provide
68
   // a pointer to a corresponding hook procedure.
69
#define CDERR_NOTEMPLATE 0x0003
70
#define CDERR_NOTEMPLATE_MSG "The ENABLETEMPLATE flag was set, but you failed to provide a corresponding template."
71
   // The ENABLETEMPLATE flag was set in the Flags member of the initialization
72
   // structure for the corresponding common dialog box, but you failed to provide
73
   // a corresponding template.
74
#define CDERR_REGISTERMSGFAIL 0x000C
75
#define CDERR_REGISTERMSGFAIL_MSG "The RegisterWindowMessage function returned an error code when it was called by the file browse dialog box function. "
76
   // The RegisterWindowMessage function returned an error code when it was called
77
   // by the common dialog box function.
78
#define CDERR_STRUCTSIZE 0x0001
79
#define CDERR_STRUCTSIZE_MSG "The lStructSize member of the initialization structure for the corresponding file browse dialog box is invalid. "
80
   // The lStructSize member of the initialization structure for the corresponding
81
   // common dialog box is invalid.
82
#define FNERR_BUFFERTOOSMALL 0x3003
83
#define FNERR_BUFFERTOOSMALL_MSG "The buffer pointed to by the lpstrFile member of the OPENFILENAME structure is too small for the filename specified by the user."
84
   // The buffer pointed to by the lpstrFile member of the OPENFILENAME structure
85
   // is too small for the filename specified by the user. The first  two bytes
86
   // of the lpstrFile buffer contain an  integer value specifying the size, in bytes
87
   // (ANSI version) or 16-bit characters (Unicode  version), required to receive the full name.
88
#define FNERR_INVALIDFILENAME 0x3002
89
#define FNERR_INVALIDFILENAME_MSG "A filename is invalid."
90
   // A filename is invalid.
91
#define FNERR_SUBCLASSFAILURE 0x3001
92
#define FNERR_SUBCLASSFAILURE_MSG "An attempt to subclass a list box failed because sufficient memory was not available."
93
   // An attempt to subclass a list box failed because sufficient memory was not available.
94
 
95
 
96
// OPENFILENAME structure. Notice that all string members below are declared
97
// as LONG. For example, lpstrFilter. Do not use STRING.
98
typedef OPENFILENAME
99
    begin
100
        LONG     lStructSize;
101
        HWND     hwndOwner;
102
        HWND     hInstance;
103
        POINTER  lpstrFilter;
104
        POINTER  lpstrCustomFilter;
105
        LONG     nMaxCustFilter;
106
        LONG     nFilterIndex;
107
        POINTER  lpstrFile;
108
        LONG     nMaxFile;
109
        POINTER  lpstrFileTitle;
110
        LONG     nMaxFileTitle;
111
        POINTER  lpstrInitialDir;
112
        POINTER  lpstrTitle;
113
        LONG     Flags;
114
        SHORT    nFileOffset;
115
        SHORT    nFileExtension;
116
        POINTER  lpstrDefExt;
117
        POINTER  lCustData;
118
        POINTER  lpfnHook;
119
        POINTER  lpTemplateName;
120
    end;
121
 
122
// Windows API declares.
123
prototype comdlg32.GetOpenFileNameA( LONG );
124
prototype comdlg32.CommDlgExtendedError();
125
prototype user32.wsprintf(BYREF STRING, BYREF STRING, POINTER);
126
 
127
// Our file browse API, defined in matching .rul file.
128
prototype FileBrowseDlg( BYREF STRING, STRING, STRING, STRING, BOOL, LIST , BOOL);
129
 
130
#endif
131
 
132
 
133
 
134