| 
            Last change
 on this file since 937 was             907, checked in by Steven Levine, 18 years ago           | 
        
        
          | 
             
Avoid out of memory traps in Compare Directories 
Rework Compare Directories progress display for 2 second update rate 
Start refactoring to reduce dependence on fm3dll.h 
Add timer services (IsITimerExpired etc.) 
 
           | 
        
        
          
            
              - 
Property                 svn:eol-style
 set to                 
native
               
              - 
Property                 svn:keywords
 set to                 
Author Date Id Revision
               
             
           | 
        
        
          | 
            File size:
            1.4 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | 
 | 
|---|
| 2 | /***********************************************************************
 | 
|---|
| 3 | 
 | 
|---|
| 4 |   $Id: undel.c 907 2008-01-06 07:26:17Z stevenhl $
 | 
|---|
| 5 | 
 | 
|---|
| 6 |   File undelete applet
 | 
|---|
| 7 | 
 | 
|---|
| 8 |   Copyright (c) 1993-98 M. Kimes
 | 
|---|
| 9 |   Copyright (c) 2007 Steven H. Levine
 | 
|---|
| 10 | 
 | 
|---|
| 11 |   23 Sep 07 SHL Sync with standards
 | 
|---|
| 12 |   23 Sep 07 SHL Get rid of statics
 | 
|---|
| 13 | 
 | 
|---|
| 14 | ***********************************************************************/
 | 
|---|
| 15 | 
 | 
|---|
| 16 | #include <string.h>
 | 
|---|
| 17 | 
 | 
|---|
| 18 | #define INCL_DOS
 | 
|---|
| 19 | 
 | 
|---|
| 20 | #include "dll\fm3dlg.h"
 | 
|---|
| 21 | #include "dll\fm3dll.h"
 | 
|---|
| 22 | 
 | 
|---|
| 23 | int main(int argc, char *argv[])
 | 
|---|
| 24 | {
 | 
|---|
| 25 |   HAB hab;
 | 
|---|
| 26 |   HMQ hmq;
 | 
|---|
| 27 |   FILESTATUS3 fs;
 | 
|---|
| 28 |   CHAR fullname[CCHMAXPATH];
 | 
|---|
| 29 |   CHAR *thisarg = NULL;
 | 
|---|
| 30 |   INT x;
 | 
|---|
| 31 | 
 | 
|---|
| 32 |   DosError(FERR_DISABLEHARDERR);
 | 
|---|
| 33 |   for (x = 1; x < argc; x++) {
 | 
|---|
| 34 |     if (!strchr("/;,`\'", *argv[x]) && !thisarg) {
 | 
|---|
| 35 |       thisarg = argv[x];
 | 
|---|
| 36 |       break;
 | 
|---|
| 37 |     }
 | 
|---|
| 38 |   }
 | 
|---|
| 39 |   if (!thisarg) {
 | 
|---|
| 40 |     thisarg = fullname;
 | 
|---|
| 41 |     save_dir(fullname);
 | 
|---|
| 42 |   }
 | 
|---|
| 43 |   DosError(FERR_DISABLEHARDERR);
 | 
|---|
| 44 |   if (thisarg && !DosQueryPathInfo(thisarg, FIL_STANDARD, &fs, sizeof(fs))) {
 | 
|---|
| 45 |     if (DosQueryPathInfo(thisarg,
 | 
|---|
| 46 |                          FIL_QUERYFULLNAME, fullname, sizeof(fullname)))
 | 
|---|
| 47 |       strcpy(fullname, thisarg);
 | 
|---|
| 48 |     hab = WinInitialize(0);
 | 
|---|
| 49 |     if (hab) {
 | 
|---|
| 50 |       hmq = WinCreateMsgQueue(hab, 256);
 | 
|---|
| 51 |       if (hmq) {
 | 
|---|
| 52 |         if (InitFM3DLL(hab, argc, argv)) {
 | 
|---|
| 53 |           MakeValidDir(fullname);
 | 
|---|
| 54 |           WinDlgBox(HWND_DESKTOP,
 | 
|---|
| 55 |                     HWND_DESKTOP,
 | 
|---|
| 56 |                     UndeleteDlgProc,
 | 
|---|
| 57 |                     FM3ModHandle,
 | 
|---|
| 58 |                     UNDEL_FRAME,
 | 
|---|
| 59 |                     fullname);
 | 
|---|
| 60 |         }
 | 
|---|
| 61 |         DosSleep(250);
 | 
|---|
| 62 |         WinDestroyMsgQueue(hmq);
 | 
|---|
| 63 |       }
 | 
|---|
| 64 |       WinTerminate(hab);
 | 
|---|
| 65 |     }
 | 
|---|
| 66 |   }
 | 
|---|
| 67 |   else
 | 
|---|
| 68 |     DosBeep(250, 100);
 | 
|---|
| 69 |   return 0;
 | 
|---|
| 70 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.