| 1 | 
 | 
|---|
| 2 | /***********************************************************************
 | 
|---|
| 3 | 
 | 
|---|
| 4 |   $Id: getnames.c 793 2007-08-21 02:53:38Z gyoung $
 | 
|---|
| 5 | 
 | 
|---|
| 6 |   Directory containers
 | 
|---|
| 7 | 
 | 
|---|
| 8 |   Copyright (c) 1993-98 M. Kimes
 | 
|---|
| 9 |   Copyright (c) 2006 Steven H. Levine
 | 
|---|
| 10 | 
 | 
|---|
| 11 |   23 Aug 06 SHL Comments
 | 
|---|
| 12 |   20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
 | 
|---|
| 13 | 
 | 
|---|
| 14 | ***********************************************************************/
 | 
|---|
| 15 | 
 | 
|---|
| 16 | #define INCL_DOS
 | 
|---|
| 17 | #define INCL_WIN
 | 
|---|
| 18 | #include <os2.h>
 | 
|---|
| 19 | 
 | 
|---|
| 20 | #include <stdlib.h>
 | 
|---|
| 21 | #include <stdio.h>
 | 
|---|
| 22 | #include <string.h>
 | 
|---|
| 23 | #include <time.h>
 | 
|---|
| 24 | 
 | 
|---|
| 25 | #include <ctype.h>
 | 
|---|
| 26 | #include "fm3dll.h"
 | 
|---|
| 27 | #include "fm3dlg.h"
 | 
|---|
| 28 | #include "fm3str.h"
 | 
|---|
| 29 | 
 | 
|---|
| 30 | #pragma data_seg(DATA1)
 | 
|---|
| 31 | 
 | 
|---|
| 32 | MRESULT EXPENTRY CustomFileDlg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 | 
|---|
| 33 | {
 | 
|---|
| 34 |   switch (msg) {
 | 
|---|
| 35 |   case WM_INITDLG:
 | 
|---|
| 36 |     if (!loadedudirs)
 | 
|---|
| 37 |       load_udirs();
 | 
|---|
| 38 |     {                                   /* fill user list box */
 | 
|---|
| 39 |       ULONG ulDriveNum, ulDriveMap;
 | 
|---|
| 40 |       ULONG ulSearchCount;
 | 
|---|
| 41 |       FILEFINDBUF3 findbuf;
 | 
|---|
| 42 |       HDIR hDir;
 | 
|---|
| 43 |       APIRET rc;
 | 
|---|
| 44 |       LINKDIRS *info, *temp;
 | 
|---|
| 45 | 
 | 
|---|
| 46 |       DosError(FERR_DISABLEHARDERR);
 | 
|---|
| 47 |       DosQCurDisk(&ulDriveNum, &ulDriveMap);
 | 
|---|
| 48 |       info = udirhead;
 | 
|---|
| 49 |       while (info) {
 | 
|---|
| 50 |         if (IsFullName(info->path) &&
 | 
|---|
| 51 |             !(driveflags[toupper(*info->path) - 'A'] &
 | 
|---|
| 52 |               (DRIVE_IGNORE | DRIVE_INVALID))) {
 | 
|---|
| 53 |           DosError(FERR_DISABLEHARDERR);
 | 
|---|
| 54 |           hDir = HDIR_CREATE;
 | 
|---|
| 55 |           ulSearchCount = 1L;
 | 
|---|
| 56 |           if (!IsRoot(info->path))
 | 
|---|
| 57 |             rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY |
 | 
|---|
| 58 |                               MUST_HAVE_DIRECTORY | FILE_READONLY |
 | 
|---|
| 59 |                               FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
 | 
|---|
| 60 |                               &findbuf, sizeof(FILEFINDBUF3),
 | 
|---|
| 61 |                               &ulSearchCount, FIL_STANDARD);
 | 
|---|
| 62 |           else {
 | 
|---|
| 63 |             rc = 0;
 | 
|---|
| 64 |             findbuf.attrFile = FILE_DIRECTORY;
 | 
|---|
| 65 |           }
 | 
|---|
| 66 |           if (!rc) {
 | 
|---|
| 67 |             if (!IsRoot(info->path))
 | 
|---|
| 68 |               DosFindClose(hDir);
 | 
|---|
| 69 |             if (findbuf.attrFile & FILE_DIRECTORY)
 | 
|---|
| 70 |               WinSendDlgItemMsg(hwnd, FDLG_USERDIRS, LM_INSERTITEM,
 | 
|---|
| 71 |                                 MPFROM2SHORT(LIT_SORTASCENDING, 0),
 | 
|---|
| 72 |                                 MPFROMP(info->path));
 | 
|---|
| 73 |             else {
 | 
|---|
| 74 |               temp = info->next;
 | 
|---|
| 75 |               remove_udir(info->path);
 | 
|---|
| 76 |               info = temp;
 | 
|---|
| 77 |               continue;
 | 
|---|
| 78 |             }
 | 
|---|
| 79 |           }
 | 
|---|
| 80 |           else if (!(ulDriveMap & (1L << (toupper(*info->path) - 'A')))) {
 | 
|---|
| 81 |             temp = info->next;
 | 
|---|
| 82 |             remove_udir(info->path);
 | 
|---|
| 83 |             info = temp;
 | 
|---|
| 84 |             continue;
 | 
|---|
| 85 |           }
 | 
|---|
| 86 |         }
 | 
|---|
| 87 |         info = info->next;
 | 
|---|
| 88 |       }
 | 
|---|
| 89 |     }
 | 
|---|
| 90 |     break;
 | 
|---|
| 91 | 
 | 
|---|
| 92 |   case WM_ADJUSTWINDOWPOS:
 | 
|---|
| 93 |     PostMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
 | 
|---|
| 94 |     break;
 | 
|---|
| 95 | 
 | 
|---|
| 96 |   case UM_SETDIR:
 | 
|---|
| 97 |     PaintRecessedWindow(WinWindowFromID(hwnd, FDLG_HELP),
 | 
|---|
| 98 |                         (HPS) 0, FALSE, TRUE);
 | 
|---|
| 99 |     return 0;
 | 
|---|
| 100 | 
 | 
|---|
| 101 |   case WM_CONTROL:
 | 
|---|
| 102 |     switch (SHORT1FROMMP(mp1)) {
 | 
|---|
| 103 |     case 260:                           /* drives dropdown list */
 | 
|---|
| 104 |       switch (SHORT2FROMMP(mp1)) {
 | 
|---|
| 105 |       case CBN_SHOWLIST:
 | 
|---|
| 106 |         WinSetDlgItemText(hwnd,
 | 
|---|
| 107 |                           FDLG_HELP, GetPString(IDS_CLICKDRIVEHELPTEXT));
 | 
|---|
| 108 |         break;
 | 
|---|
| 109 |       }
 | 
|---|
| 110 |       break;
 | 
|---|
| 111 | 
 | 
|---|
| 112 |     case 258:                           /* name entry field */
 | 
|---|
| 113 |       switch (SHORT2FROMMP(mp1)) {
 | 
|---|
| 114 |       case EN_SETFOCUS:
 | 
|---|
| 115 |         WinSetDlgItemText(hwnd,
 | 
|---|
| 116 |                           FDLG_HELP, GetPString(IDS_ENTERFILEORMASKHELPTEXT));
 | 
|---|
| 117 |         break;
 | 
|---|
| 118 |       case EN_KILLFOCUS:
 | 
|---|
| 119 |         WinSetDlgItemText(hwnd, FDLG_HELP, GetPString(IDS_NAMEDEFHELPTEXT));
 | 
|---|
| 120 |         break;
 | 
|---|
| 121 |       }
 | 
|---|
| 122 |       break;
 | 
|---|
| 123 | 
 | 
|---|
| 124 |     case 264:                           /* dirs listbox */
 | 
|---|
| 125 |       switch (SHORT2FROMMP(mp1)) {
 | 
|---|
| 126 |       case LN_SETFOCUS:
 | 
|---|
| 127 |         WinSetDlgItemText(hwnd,
 | 
|---|
| 128 |                           FDLG_HELP, GetPString(IDS_DBLCLKDIRSWITCHHELPTEXT));
 | 
|---|
| 129 |         break;
 | 
|---|
| 130 |       case LN_KILLFOCUS:
 | 
|---|
| 131 |         WinSetDlgItemText(hwnd, FDLG_HELP, GetPString(IDS_NAMEDEFHELPTEXT));
 | 
|---|
| 132 |         break;
 | 
|---|
| 133 |       }
 | 
|---|
| 134 |       break;
 | 
|---|
| 135 | 
 | 
|---|
| 136 |     case 266:                           /* files listbox */
 | 
|---|
| 137 |       switch (SHORT2FROMMP(mp1)) {
 | 
|---|
| 138 |       case LN_SETFOCUS:
 | 
|---|
| 139 |         WinSetDlgItemText(hwnd, FDLG_HELP,
 | 
|---|
| 140 |                           GetPString(IDS_DBLCLKFILEUSEHELPTEXT));
 | 
|---|
| 141 |         break;
 | 
|---|
| 142 |       case LN_KILLFOCUS:
 | 
|---|
| 143 |         WinSetDlgItemText(hwnd, FDLG_HELP, GetPString(IDS_NAMEDEFHELPTEXT));
 | 
|---|
| 144 |         break;
 | 
|---|
| 145 |       }
 | 
|---|
| 146 |       break;
 | 
|---|
| 147 | 
 | 
|---|
| 148 |     case FDLG_USERDIRS:
 | 
|---|
| 149 |       switch (SHORT2FROMMP(mp1)) {
 | 
|---|
| 150 |       case CBN_SHOWLIST:
 | 
|---|
| 151 |         WinSetDlgItemText(hwnd,
 | 
|---|
| 152 |                           FDLG_HELP, GetPString(IDS_DBLCLKDIRSWITCHHELPTEXT));
 | 
|---|
| 153 |         break;
 | 
|---|
| 154 |       case CBN_ENTER:
 | 
|---|
| 155 |         {
 | 
|---|
| 156 |           SHORT sSelect;
 | 
|---|
| 157 |           CHAR szBuffer[CCHMAXPATH], szTemp[CCHMAXPATH], *p;
 | 
|---|
| 158 | 
 | 
|---|
| 159 |           sSelect = (USHORT) WinSendDlgItemMsg(hwnd,
 | 
|---|
| 160 |                                                FDLG_USERDIRS,
 | 
|---|
| 161 |                                                LM_QUERYSELECTION,
 | 
|---|
| 162 |                                                MPVOID, MPVOID);
 | 
|---|
| 163 |           *szBuffer = 0;
 | 
|---|
| 164 |           if (sSelect >= 0) {
 | 
|---|
| 165 |             WinSendDlgItemMsg(hwnd,
 | 
|---|
| 166 |                               FDLG_USERDIRS,
 | 
|---|
| 167 |                               LM_QUERYITEMTEXT,
 | 
|---|
| 168 |                               MPFROM2SHORT(sSelect,
 | 
|---|
| 169 |                                            CCHMAXPATH), MPFROMP(szBuffer));
 | 
|---|
| 170 |             if (*szBuffer) {
 | 
|---|
| 171 |               if (szBuffer[strlen(szBuffer) - 1] != '\\')
 | 
|---|
| 172 |                 strcat(szBuffer, "\\");
 | 
|---|
| 173 |               *szTemp = 0;
 | 
|---|
| 174 |               WinQueryDlgItemText(hwnd, 258, CCHMAXPATH, szTemp);
 | 
|---|
| 175 |               p = strrchr(szTemp, '\\');
 | 
|---|
| 176 |               if (!p)
 | 
|---|
| 177 |                 p = szTemp;
 | 
|---|
| 178 |               else
 | 
|---|
| 179 |                 p++;
 | 
|---|
| 180 |               if (*p)
 | 
|---|
| 181 |                 strcat(szBuffer, p);
 | 
|---|
| 182 |               if (!strchr(szBuffer, '?') && !strchr(szBuffer, '*'))
 | 
|---|
| 183 |                 strcat(szBuffer, "*");
 | 
|---|
| 184 |               WinSetDlgItemText(hwnd, 258, szBuffer);
 | 
|---|
| 185 |               PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(DID_OK, 0), MPVOID);
 | 
|---|
| 186 |             }
 | 
|---|
| 187 |           }
 | 
|---|
| 188 |         }
 | 
|---|
| 189 |         break;
 | 
|---|
| 190 |       default:
 | 
|---|
| 191 |         break;
 | 
|---|
| 192 |       }
 | 
|---|
| 193 |       break;
 | 
|---|
| 194 |     }
 | 
|---|
| 195 |     break;
 | 
|---|
| 196 | 
 | 
|---|
| 197 |   case WM_HELP:
 | 
|---|
| 198 |     if (hwndHelp) {
 | 
|---|
| 199 |       WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
 | 
|---|
| 200 |                  MPFROM2SHORT(HELP_FILEDLG, 0), MPFROMSHORT(HM_RESOURCEID));
 | 
|---|
| 201 |       return 0;
 | 
|---|
| 202 |     }
 | 
|---|
| 203 |     break;
 | 
|---|
| 204 |   }
 | 
|---|
| 205 |   return WinDefFileDlgProc(hwnd, msg, mp1, mp2);
 | 
|---|
| 206 | }
 | 
|---|
| 207 | 
 | 
|---|
| 208 | BOOL insert_filename(HWND hwnd, CHAR * filename, INT loadit, BOOL newok)
 | 
|---|
| 209 | {
 | 
|---|
| 210 |   FILEDLG fdlg;
 | 
|---|
| 211 |   FILESTATUS3 fsa;
 | 
|---|
| 212 |   CHAR drive[3], *pdrive = drive, *p;
 | 
|---|
| 213 |   APIRET rc;
 | 
|---|
| 214 |   static CHAR lastfilename[CCHMAXPATH] = "";
 | 
|---|
| 215 | 
 | 
|---|
| 216 |   if (!filename)
 | 
|---|
| 217 |     return FALSE;
 | 
|---|
| 218 |   memset(&fdlg, 0, sizeof(FILEDLG));
 | 
|---|
| 219 |   fdlg.cbSize = (ULONG) sizeof(FILEDLG);
 | 
|---|
| 220 |   fdlg.fl = FDS_CENTER | FDS_OPEN_DIALOG;
 | 
|---|
| 221 |   if (!loadit) {
 | 
|---|
| 222 |     fdlg.pszTitle = GetPString(IDS_ENTERFILEINSERTTEXT);
 | 
|---|
| 223 |     fdlg.pszOKButton = GetPString(IDS_INSERTTEXT);
 | 
|---|
| 224 |   }
 | 
|---|
| 225 |   else if (loadit == TRUE) {
 | 
|---|
| 226 |     fdlg.pszTitle = GetPString(IDS_ENTERFILELOADTEXT);
 | 
|---|
| 227 |     fdlg.pszOKButton = GetPString(IDS_LOADTEXT);
 | 
|---|
| 228 |   }
 | 
|---|
| 229 |   else {
 | 
|---|
| 230 |     fdlg.pszTitle = GetPString(IDS_ENTERFILETEXT);
 | 
|---|
| 231 |     fdlg.pszOKButton = GetPString(IDS_OKAYTEXT);
 | 
|---|
| 232 |   }
 | 
|---|
| 233 |   if (IsFullName(filename)) {
 | 
|---|
| 234 |     *drive = *filename;
 | 
|---|
| 235 |     drive[1] = ':';
 | 
|---|
| 236 |     drive[2] = 0;
 | 
|---|
| 237 |     fdlg.pszIDrive = pdrive;
 | 
|---|
| 238 |   }
 | 
|---|
| 239 |   else if (*lastfilename) {
 | 
|---|
| 240 |     *drive = *lastfilename;
 | 
|---|
| 241 |     drive[1] = ':';
 | 
|---|
| 242 |     drive[2] = 0;
 | 
|---|
| 243 |     fdlg.pszIDrive = pdrive;
 | 
|---|
| 244 |   }
 | 
|---|
| 245 | 
 | 
|---|
| 246 |   if (!*filename) {
 | 
|---|
| 247 |     if (*lastfilename) {
 | 
|---|
| 248 |       strcpy(fdlg.szFullFile, lastfilename);
 | 
|---|
| 249 |       p = strrchr(fdlg.szFullFile, '\\');
 | 
|---|
| 250 |       if (p) {
 | 
|---|
| 251 |         p++;
 | 
|---|
| 252 |         *p = 0;
 | 
|---|
| 253 |       }
 | 
|---|
| 254 |     }
 | 
|---|
| 255 |     if (!loadit || loadit == TRUE)
 | 
|---|
| 256 |       strcat(fdlg.szFullFile, "*.TXT");
 | 
|---|
| 257 |     else
 | 
|---|
| 258 |       strcat(fdlg.szFullFile, "*");
 | 
|---|
| 259 |   }
 | 
|---|
| 260 |   else
 | 
|---|
| 261 |     strcpy(fdlg.szFullFile, filename);
 | 
|---|
| 262 | 
 | 
|---|
| 263 |   if (fCustomFileDlg) {
 | 
|---|
| 264 |     fdlg.fl |= FDS_HELPBUTTON | FDS_CUSTOM;
 | 
|---|
| 265 |     fdlg.pfnDlgProc = (PFNWP) CustomFileDlg;
 | 
|---|
| 266 |     fdlg.hMod = FM3ModHandle;
 | 
|---|
| 267 |     fdlg.usDlgId = FDLG_FRAME;
 | 
|---|
| 268 |   }
 | 
|---|
| 269 | 
 | 
|---|
| 270 |   if (WinFileDlg(HWND_DESKTOP, hwnd, &fdlg)) {
 | 
|---|
| 271 |     if (fdlg.lReturn != DID_CANCEL && !fdlg.lSRC)
 | 
|---|
| 272 |       strcpy(filename, fdlg.szFullFile);
 | 
|---|
| 273 |     else
 | 
|---|
| 274 |       return FALSE;
 | 
|---|
| 275 |   }
 | 
|---|
| 276 |   else
 | 
|---|
| 277 |     return FALSE;
 | 
|---|
| 278 |   MakeFullName(filename);
 | 
|---|
| 279 |   if (!DosQueryPathInfo(filename, FIL_STANDARD, &fsa, sizeof(fsa))) {
 | 
|---|
| 280 |     if (fsa.attrFile & FILE_DIRECTORY) {
 | 
|---|
| 281 |       /* device or directory */
 | 
|---|
| 282 |       saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
 | 
|---|
| 283 |              hwnd, filename, GetPString(IDS_EXISTSBUTNOTFILETEXT), filename);
 | 
|---|
| 284 |       return FALSE;
 | 
|---|
| 285 |     }
 | 
|---|
| 286 |     else if (fsa.cbFile == 0L) {
 | 
|---|
| 287 |       saymsg(MB_CANCEL,
 | 
|---|
| 288 |              hwnd, filename, GetPString(IDS_ISZEROLENGTHTEXT), filename);
 | 
|---|
| 289 |       return FALSE;
 | 
|---|
| 290 |     }
 | 
|---|
| 291 |   }
 | 
|---|
| 292 |   else if (!newok) {
 | 
|---|
| 293 |     saymsg(MB_CANCEL,
 | 
|---|
| 294 |            hwnd, filename, GetPString(IDS_DOESNTEXISTTEXT), filename);
 | 
|---|
| 295 |     return FALSE;
 | 
|---|
| 296 |   }
 | 
|---|
| 297 |   else {
 | 
|---|
| 298 |     rc = saymsg(MB_YESNOCANCEL,
 | 
|---|
| 299 |                 hwnd, filename, GetPString(IDS_CREATENEWTEXT));
 | 
|---|
| 300 |     if (rc != MBID_YES)
 | 
|---|
| 301 |       return FALSE;
 | 
|---|
| 302 |   }
 | 
|---|
| 303 |   p = filename;
 | 
|---|
| 304 |   while (*p) {
 | 
|---|
| 305 |     if (*p == '/')
 | 
|---|
| 306 |       *p = '\\';
 | 
|---|
| 307 |     p++;
 | 
|---|
| 308 |   }
 | 
|---|
| 309 |   if (*filename)
 | 
|---|
| 310 |     strcpy(lastfilename, filename);
 | 
|---|
| 311 |   return TRUE;
 | 
|---|
| 312 | }
 | 
|---|
| 313 | 
 | 
|---|
| 314 | BOOL export_filename(HWND hwnd, CHAR * filename, INT overwrite)
 | 
|---|
| 315 | {
 | 
|---|
| 316 |   FILEDLG fdlg;
 | 
|---|
| 317 |   FILESTATUS3 fsa;
 | 
|---|
| 318 |   CHAR drive[3], *pdrive = drive, *p;
 | 
|---|
| 319 |   static CHAR lastfilename[CCHMAXPATH] = "";
 | 
|---|
| 320 | 
 | 
|---|
| 321 |   if (!filename)
 | 
|---|
| 322 |     return FALSE;
 | 
|---|
| 323 |   memset(&fdlg, 0, sizeof(FILEDLG));
 | 
|---|
| 324 |   fdlg.cbSize = sizeof(FILEDLG);
 | 
|---|
| 325 |   fdlg.fl = FDS_CENTER | FDS_OPEN_DIALOG;
 | 
|---|
| 326 |   fdlg.pszTitle = GetPString(IDS_EXPORTNAMETITLETEXT);
 | 
|---|
| 327 |   fdlg.pszOKButton = GetPString(IDS_OKAYTEXT);
 | 
|---|
| 328 |   if (IsFullName(filename)) {
 | 
|---|
| 329 |     *drive = *filename;
 | 
|---|
| 330 |     drive[1] = ':';
 | 
|---|
| 331 |     drive[2] = 0;
 | 
|---|
| 332 |     fdlg.pszIDrive = pdrive;
 | 
|---|
| 333 |   }
 | 
|---|
| 334 |   else if (*lastfilename) {
 | 
|---|
| 335 |     *drive = *lastfilename;
 | 
|---|
| 336 |     drive[1] = ':';
 | 
|---|
| 337 |     drive[2] = 0;
 | 
|---|
| 338 |     fdlg.pszIDrive = pdrive;
 | 
|---|
| 339 |   }
 | 
|---|
| 340 |   if (!*filename) {
 | 
|---|
| 341 |     if (*lastfilename) {
 | 
|---|
| 342 |       strcpy(fdlg.szFullFile, lastfilename);
 | 
|---|
| 343 |       p = strrchr(fdlg.szFullFile, '\\');
 | 
|---|
| 344 |       if (p) {
 | 
|---|
| 345 |         p++;
 | 
|---|
| 346 |         *p = 0;
 | 
|---|
| 347 |       }
 | 
|---|
| 348 |     }
 | 
|---|
| 349 |     strcat(fdlg.szFullFile, "*.TXT");
 | 
|---|
| 350 |   }
 | 
|---|
| 351 |   else
 | 
|---|
| 352 |     strcpy(fdlg.szFullFile, filename);
 | 
|---|
| 353 | 
 | 
|---|
| 354 |   if (fCustomFileDlg) {
 | 
|---|
| 355 |     fdlg.fl |= FDS_HELPBUTTON | FDS_CUSTOM;
 | 
|---|
| 356 |     fdlg.pfnDlgProc = (PFNWP) CustomFileDlg;
 | 
|---|
| 357 |     fdlg.hMod = FM3ModHandle;
 | 
|---|
| 358 |     fdlg.usDlgId = FDLG_FRAME;
 | 
|---|
| 359 |   }
 | 
|---|
| 360 | 
 | 
|---|
| 361 |   if (WinFileDlg(HWND_DESKTOP, hwnd, &fdlg)) {
 | 
|---|
| 362 |     if (fdlg.lReturn != DID_CANCEL && !fdlg.lSRC)
 | 
|---|
| 363 |       strcpy(filename, fdlg.szFullFile);
 | 
|---|
| 364 |     else
 | 
|---|
| 365 |       return FALSE;
 | 
|---|
| 366 |   }
 | 
|---|
| 367 |   else
 | 
|---|
| 368 |     return FALSE;
 | 
|---|
| 369 |   MakeFullName(filename);
 | 
|---|
| 370 |   if (!DosQueryPathInfo(filename, FIL_STANDARD, &fsa, sizeof(fsa))) {
 | 
|---|
| 371 |     if (fsa.attrFile & FILE_DIRECTORY) {        /* device or directory */
 | 
|---|
| 372 |       saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
 | 
|---|
| 373 |              hwnd, filename, GetPString(IDS_EXISTSBUTNOTFILETEXT), filename);
 | 
|---|
| 374 |       return FALSE;
 | 
|---|
| 375 |     }
 | 
|---|
| 376 |     else if (overwrite && fsa.cbFile != 0L) {
 | 
|---|
| 377 |       if (saymsg(MB_YESNO,
 | 
|---|
| 378 |                  hwnd,
 | 
|---|
| 379 |                  filename,
 | 
|---|
| 380 |                  GetPString(IDS_EXISTSERASETEXT), filename) == MBID_YES)
 | 
|---|
| 381 |         unlinkf("%s", filename);
 | 
|---|
| 382 |     }
 | 
|---|
| 383 |   }
 | 
|---|
| 384 |   p = filename;
 | 
|---|
| 385 |   while (*p) {
 | 
|---|
| 386 |     if (*p == '/')
 | 
|---|
| 387 |       *p = '\\';
 | 
|---|
| 388 |     p++;
 | 
|---|
| 389 |   }
 | 
|---|
| 390 |   if (*filename)
 | 
|---|
| 391 |     strcpy(lastfilename, filename);
 | 
|---|
| 392 |   return TRUE;
 | 
|---|
| 393 | }
 | 
|---|
| 394 | 
 | 
|---|
| 395 | #pragma alloc_text(GETNAMES,insert_filename,export_filename,CustomFileDlg)
 | 
|---|