71 |
} /* set_menu_state */ |
} /* set_menu_state */ |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
/* Use the common dialog to request a file from the user. |
/* Use the common dialog to request a file from the user. |
76 |
id can be either FILE_OPEN or FILE_SAVE. |
id can be either FILE_OPEN or FILE_SAVE. |
77 |
The return value is the file name or NULL if cancel was chosen. */ |
The return value is the file name or NULL if cancel was chosen. */ |
109 |
return NULL; |
return NULL; |
110 |
} |
} |
111 |
|
|
112 |
|
const char* |
113 |
|
get_filesave_dlg (HWND hwnd, const char *title, |
114 |
|
const char *filter, const char *name) |
115 |
|
{ |
116 |
|
return get_filename_dlg (hwnd, FILE_SAVE, title, filter, name); |
117 |
|
} |
118 |
|
|
119 |
|
const char * |
120 |
|
get_fileopen_dlg (HWND hwnd, const char *title, const char *filter, |
121 |
|
const char *name) |
122 |
|
{ |
123 |
|
return get_filename_dlg (hwnd, FILE_OPEN, title, filter, name); |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
/* Use the common dialog to allow the user to select a folder. |
/* Use the common dialog to allow the user to select a folder. |
128 |
The return value is either the folder path or NULL if cancel was chosen. */ |
The return value is either the folder path or NULL if cancel was chosen. */ |
129 |
const char* |
const char* |
276 |
/* return 0 if it exists, otherwise >0. */ |
/* return 0 if it exists, otherwise >0. */ |
277 |
int |
int |
278 |
file_exist_check (const char * fname) |
file_exist_check (const char * fname) |
279 |
{ |
{ |
280 |
HANDLE fh; |
struct stat st; |
281 |
|
if (stat (fname, &st) == -1) |
|
fh = CreateFile( fname, GENERIC_READ, FILE_SHARE_READ, |
|
|
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); |
|
|
if( fh == INVALID_HANDLE_VALUE ) |
|
282 |
return WPTERR_FILE_EXIST; |
return WPTERR_FILE_EXIST; |
|
CloseHandle( fh ); |
|
283 |
return 0; |
return 0; |
284 |
} |
} |
285 |
|
|