|
|
1.1 root 1: #include <windows.h>
2: #include <commdlg.h>
3: #include <string.h>
4: #include <stdlib.h>
5:
6: #ifdef RC_INVOKED
7: #define ID(id) id
8: #else
9: #define ID(id) MAKEINTRESOURCE(id)
10: #endif
11:
12: #undef EDIT_FIXED
13:
14: // resource ID's
15: #define IDPortTool ID(1)
16: #define IDBkPort ID(2)
17:
18: #define IDA_PORTTOOL 1
19:
20: // edit control child window ID
21: #define IDC_EDIT 1000
22:
23: // max string lengths
24: #define MAXSEARCHSTRING 80
25: #define MAXPTRDEFINITION 200
26: #define MAXPTRDEVICE 50
27: #define MAXPTRDRIVER 50
28: #define MAXPTRPORT 50
29:
30: // extra byte window word and long definitions
31: #define WL_HWNDEDIT 0
32: #define WW_SCROLL 4
33: #define WW_UNTITLED 6
34: #define WW_SEARCHCASE 8
35: #define WW_SEARCHDN 10
36: #define WL_HPTRDEVNAMES 12
37: #define CBWNDEXTRA 16
38:
39: // menuitem IDs, file submenu
40: #define IDM_FILENEW 1001
41: #define IDM_FILEOPEN 1002
42: #define IDM_FILESAVE 1003
43: #define IDM_FILESAVEAS 1004
44: #define IDM_FILEPRINT 1005
45: #define IDM_FILESETUP 1006
46: #define IDM_FILEEXIT 1007
47: #define IDM_FILEABOUT 1008
48: // edit submenu
49: #define IDM_EDITUNDO 2000
50: #define IDM_EDITCUT WM_CUT
51: #define IDM_EDITCOPY WM_COPY
52: #define IDM_EDITPASTE WM_PASTE
53: #define IDM_EDITCLEAR WM_CLEAR
54: #define IDM_EDITSELECT 2001
55: #define IDM_EDITWRAP 2002
56: #define IDM_EDITSCROLL 2003
57: #define IDM_EDITFONT 2004
58: // search submenu
59: #define IDM_SEARCHFIND 3001
60: #define IDM_SEARCHNEXT 3002
61: #define IDM_SEARCHPREV 3003
62: // port submenu
63: #define IDM_PORTCURFILE 4000
64: #define IDM_PORTBKGND 4001
65:
66: #define IDM_FUNCTION1 5000
67: #define IDM_FUNCTION2 5001
68: #define IDM_FUNCTION3 5002
69: #define IDM_FUNCTION4 5003
70: #define IDM_FUNCTION5 5004
71:
72: // dialog & control IDs
73:
74: // about dialog
75: #define IDD_ABOUT ID(300)
76:
77: // cancel print dialog
78: #define IDD_CANCELDLG ID(400)
79: #define IDC_PRINTDEVICE 401
80: #define IDC_PRINTPORT 402
81: #define IDC_PRINTTITLE 403
82:
83: // port options dialog
84: #define IDD_OPTIONSDLG ID(500)
85: #define IDC_NOAPIS 501
86: #define IDC_NOMESSAGES 502
87: #define IDC_NOSTRUCTURES 503
88: #define IDC_NOMACROS 504
89: #define IDC_NOCONSTANTS 505
90: #define IDC_NOTYPES 506
91: #define IDC_NOCUSTOM 507
92: #define IDC_IGNORECASE 508
93: #define IDC_CURTOKEN 509
94: #define IDC_IGNORETOKEN 510
95:
96: // port current file dialog
97: #define IDD_PORTDIALOG ID(600)
98: #define IDC_SEARCHFOUND 601
99: #define IDC_ISSUECNT 602
100: #define IDC_LINENO 603
101: #define IDC_LINE 604
102: #define IDC_ISSUE 605
103: #define IDC_CONTINUE 606
104: #define IDC_SUGGESTION 608
105: #define IDC_SUGGESTLABEL 609
106: #define IDC_OPTIONS 610
107: #define IDC_DONE 611
108: #define IDC_HELP 612
109: #define IDC_RESTART 613
110:
111: // background port status dialog
112: #define IDD_BKPORTDIALOG ID(700)
113: #define IDC_BKNOAPIS 702
114: #define IDC_BKNOMESSAGES 703
115: #define IDC_BKNOSTRUCTURES 704
116: #define IDC_BKNOMACROS 705
117: #define IDC_BKNOCONSTANTS 706
118: #define IDC_BKNOTYPES 707
119: #define IDC_BKNOCUSTOM 708
120: #define IDC_BKIGNORECASE 709
121: #define IDC_CHANGEOPTIONS 710
122: #define IDC_ADDFILE 711
123: #define IDC_COMPLETE 712
124: #define IDC_LINES 713
125: #define IDC_ISSUES 714
126: #define IDC_ABORTFILE 715
127: #define IDC_FILEPATH 716
128: #define IDC_FILELIST 717
129: #define IDC_BKDONE 718
130:
131:
132: // file I/O error stringtable entries
133: #define IDS_OPENFAILED -1
134: #define IDS_NOSIZE -2
135: #define IDS_READFAILED -3
136: #define IDS_REALLOCFAILED -4
137: #define IDS_EDITWNDFAILED -5
138: #define IDS_GETHANDLEFAILED -6
139: #define IDS_WRITEOPENFAILED -7
140: #define IDS_WRITEFAILED -8
141: #define IDS_PTRCOMMDLGFAILED -9
142: #define IDS_PRINTABORTED -10
143: #define IDS_STARTDOCFAILED -11
144: #define IDS_SETABORTPROCFAILED -12
145: #define IDS_CANCELDLGFAILED -13
146: #define IDS_PTRCONFIGFAILED -14
147: #define IDS_NOFILETOPORT -15
148: #define IDS_PORTINITFAILED -16
149: #define IDS_MEMORYFAILED -17
150: #define IDS_FONTFAILEDTOCREATE -18
151: #define IDS_LOADPORTFAILED -19
152: #define IDS_PROCADDRESSFAILED -20
153: #define IDS_UNTITLED 1
154: #define IDS_APPNAME 2
155: #define IDS_PRINTJOB 3
156: #define IDS_PRINTERROR 4
157: #define IDS_DATACHANGED 5
158: #define IDS_DEFAULTFILEEXT 6
159: #define IDS_SAVEASTITLE 7
160: #define IDS_FILEOPENTITLE 8
161: #define IDS_STRINGNOTFOUND 9
162: #define IDS_SEARCHDLGFAILED 10
163: #define IDS_WINDOWSAPPNAME 11
164: #define IDS_DEVICENAME 12
165: #define IDS_PORTFILE 13
166: #define IDS_SEARCHING 14
167: #define IDS_FOUND 15
168: #define IDS_NOMOREPORTISSUES 16
169: #define IDS_INIFILE 17
170: #define IDS_WINHELP 18
171: #define IDS_NOTYETIMPLEMENTED 19
172: #define IDS_NOT 20
173: #define IDS_PORTDLLFILE 21
174: #define IDS_CHECKSTRING 22
175: #define IDS_BKPORTNEWLINE 23
176: #define IDS_BKPORTHEADER 24
177: #define IDS_BKPORTTOKEN 25
178: #define IDS_BKPORTISSUE 26
179: #define IDS_BKPORTSUGGEST 27
180: #define IDS_BKPORTHELP 28
181: #define IDS_BKPORTHELPFILE 29
182: #define IDS_BKPORTEOL 30
183: #define IDS_BKPORTABORT 31
184: #define IDS_BKPORTSTATUS 32
185: #define IDS_BKPORTCANCEL 33
186: #define IDS_BKPORTSTARTFAILED 34
187: #define IDS_CANTBUILDFILELIST 35
188:
189:
190: // define background porting handle array indexes
191: #define BKPORT_ABORT 0
192: #define BKPORT_STATUS 1
193: #define nBKPORTEVENTS 2
194:
195: #define MAXBKTHREADS 20
196:
197: // define structure used in background porting
198: typedef struct tagBkPortFile
199: {
200: char szFile[MAX_PATH];
201: char szFilePath[MAX_PATH];
202: DWORD dwPTFlags;
203: HANDLE hThread;
204: HWND hDlg;
205: }BKPORTFILESTRUCT, * LPBKPORTFILESTRUCT;
206:
207:
208: // linked list structure defines background files being ported
209: typedef struct _BKFILELIST
210: {
211: BKPORTFILESTRUCT bkFile;
212: HANDLE hEvents[nBKPORTEVENTS];
213: LPVOID Next;
214: }BKFILELIST, * LPBKFILELIST;
215:
216:
217: // function prototypes defined in PORTTOOL.C
218: #define UM_SAVEFILE WM_USER+1
219: VOID WINAPI ErrorNotify (HWND, int);
220: LONG WINAPI MainWndProc (HWND, UINT, UINT, LONG);
221: BOOL WINAPI AboutDlgProc (HWND, UINT, UINT, LONG);
222:
223: // globals and function prototypes defined in PTFILE.C
224: extern char lpszFilePath[MAX_PATH];
225: BOOL WINAPI GetFileName(HWND, char *, char *);
226: BOOL WINAPI GetFileFromPath (char *, char *);
227: BOOL WINAPI GetIniFile (char *);
228: int WINAPI SaveFile (HWND, char *);
229: BOOL WINAPI SaveAsFileName (HWND, char *, char *);
230: int WINAPI LoadFile (HWND, char *);
231:
232: // globals and function prototypes defined in PTFIND.C
233: extern char lpszSearch[MAXSEARCHSTRING+1];
234: extern HWND hDlgSearch;
235: BOOL WINAPI FindDialog (HWND, WORD, WORD, char *);
236: BOOL WINAPI LocateText (HWND, WORD, WORD, char *);
237:
238: // globals and function prototypes defined in PTPRINT.C
239: #define UM_CANCELPRINT WM_USER+2
240: int WINAPI PrintFile (HWND);
241: int WINAPI PrinterSetup (HWND);
242: BOOL WINAPI GetPrinterConfig (HWND);
243:
244: // globals and function prototypes defined in PTDLGS.C
245: BOOL WINAPI OptionsDlgProc (HWND, UINT, UINT, LONG);
246: BOOL WINAPI PortDlgProc (HWND, UINT, UINT, LONG);
247: BOOL WINAPI BkPortDlgProc (HWND, UINT, UINT, LONG);
248:
249: // globals and function prototypes defined in PTBKPORT.C
250: #define UM_THREADCOMPLETE WM_USER+2
251: #define UM_STATUSUPDATE WM_USER+3
252: HANDLE WINAPI StartBkPortThread (LPBKPORTFILESTRUCT);
253: BOOL WINAPI CreateEvents (HANDLE *, LPBKPORTFILESTRUCT);
254: void WINAPI DestroyEvents (HANDLE *);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.