1 |
|
---|
2 | /***********************************************************************
|
---|
3 |
|
---|
4 | $Id: undel.c 1189 2008-09-10 21:58:57Z jbs $
|
---|
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\fm3dll.h"
|
---|
21 | #include "dll\fm3dlg.h"
|
---|
22 | #include "dll\undel.h" // UndeleteDlgProc
|
---|
23 | #include "dll\init.h" // InitFM3DLL
|
---|
24 | #include "dll\valid.h" // MakeValidDir
|
---|
25 | #include "dll\dirs.h" // save_dir
|
---|
26 |
|
---|
27 | int main(int argc, char *argv[])
|
---|
28 | {
|
---|
29 | HAB hab;
|
---|
30 | HMQ hmq;
|
---|
31 | FILESTATUS3 fs;
|
---|
32 | CHAR fullname[CCHMAXPATH];
|
---|
33 | CHAR *thisarg = NULL;
|
---|
34 | INT x;
|
---|
35 |
|
---|
36 | DosError(FERR_DISABLEHARDERR);
|
---|
37 | for (x = 1; x < argc; x++) {
|
---|
38 | if (!strchr("/;,`\'", *argv[x]) && !thisarg) {
|
---|
39 | thisarg = argv[x];
|
---|
40 | break;
|
---|
41 | }
|
---|
42 | }
|
---|
43 | if (!thisarg) {
|
---|
44 | thisarg = fullname;
|
---|
45 | save_dir(fullname);
|
---|
46 | }
|
---|
47 | DosError(FERR_DISABLEHARDERR);
|
---|
48 | if (thisarg && !DosQueryPathInfo(thisarg, FIL_STANDARD, &fs, sizeof(fs))) {
|
---|
49 | if (DosQueryPathInfo(thisarg,
|
---|
50 | FIL_QUERYFULLNAME, fullname, sizeof(fullname)))
|
---|
51 | strcpy(fullname, thisarg);
|
---|
52 | hab = WinInitialize(0);
|
---|
53 | if (hab) {
|
---|
54 | hmq = WinCreateMsgQueue(hab, 256);
|
---|
55 | if (hmq) {
|
---|
56 | if (InitFM3DLL(hab, argc, argv)) {
|
---|
57 | MakeValidDir(fullname);
|
---|
58 | WinDlgBox(HWND_DESKTOP,
|
---|
59 | HWND_DESKTOP,
|
---|
60 | UndeleteDlgProc,
|
---|
61 | FM3ModHandle,
|
---|
62 | UNDEL_FRAME,
|
---|
63 | fullname);
|
---|
64 | }
|
---|
65 | DosSleep(250);
|
---|
66 | WinDestroyMsgQueue(hmq);
|
---|
67 | }
|
---|
68 | WinTerminate(hab);
|
---|
69 | }
|
---|
70 | }
|
---|
71 | else
|
---|
72 | DosBeep(250, 100);
|
---|
73 | return 0;
|
---|
74 | }
|
---|