1 |
|
---|
2 | /***********************************************************************
|
---|
3 |
|
---|
4 | $Id: notebook.c 869 2007-11-12 23:25:28Z jbs $
|
---|
5 |
|
---|
6 | Configuration notebook
|
---|
7 |
|
---|
8 | Copyright (c) 1993-98 M. Kimes
|
---|
9 | Copyright (c) 2004, 2007 Steven H. Levine
|
---|
10 |
|
---|
11 | 01 Aug 04 SHL Rework lstrip/rstrip usage
|
---|
12 | 23 May 05 SHL Use QWL_USER
|
---|
13 | 04 Jun 05 SHL Support Cancel button; make Esc key more consistent
|
---|
14 | 29 May 06 SHL Comments
|
---|
15 | 17 Jul 06 SHL Use Runtime_Error
|
---|
16 | 15 Aug 06 SHL Rework SetMask args
|
---|
17 | 03 Aug 07 GKY Enlarged and made setable everywhere Findbuf (speed file loading)
|
---|
18 | 13 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat
|
---|
19 | 13 Aug 07 SHL Rework FilesToGet min/max to match how DosFindFirst/Next works
|
---|
20 | 19 Aug 07 SHL Sync with SaveDirCnrState mods
|
---|
21 | 21 Aug 07 GKY Make Subject column in dircnr sizable and movable from the rigth to the left pane
|
---|
22 |
|
---|
23 | ***********************************************************************/
|
---|
24 |
|
---|
25 | #define INCL_DOS
|
---|
26 | #define INCL_WIN
|
---|
27 | #include <os2.h>
|
---|
28 |
|
---|
29 | #include <stdio.h>
|
---|
30 | #include <stdlib.h>
|
---|
31 | #include <string.h>
|
---|
32 |
|
---|
33 | #include "fm3dll.h"
|
---|
34 | #include "fm3dlg.h"
|
---|
35 | #include "fm3str.h"
|
---|
36 |
|
---|
37 | #pragma data_seg(DATA2)
|
---|
38 |
|
---|
39 | static PSZ pszSrcFile = __FILE__;
|
---|
40 |
|
---|
41 | typedef struct
|
---|
42 | {
|
---|
43 | USHORT frameid;
|
---|
44 | ULONG title;
|
---|
45 | PFNWP proc;
|
---|
46 | HWND hwnd;
|
---|
47 | ULONG helpid;
|
---|
48 | ULONG pageID;
|
---|
49 | }
|
---|
50 | NOTEPAGES;
|
---|
51 |
|
---|
52 | static HWND hwndNotebook;
|
---|
53 |
|
---|
54 | MRESULT EXPENTRY CfgADlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
55 | {
|
---|
56 | switch (msg) {
|
---|
57 | case WM_INITDLG:
|
---|
58 | WinSendDlgItemMsg(hwnd, CFGA_VIRUS, EM_SETTEXTLIMIT,
|
---|
59 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
60 | WinSendDlgItemMsg(hwnd, CFGA_EXTRACTPATH, EM_SETTEXTLIMIT,
|
---|
61 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
62 | WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), FALSE);
|
---|
63 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
64 | break;
|
---|
65 |
|
---|
66 | case UM_UNDO:
|
---|
67 | WinCheckButton(hwnd, CFGA_ARCSTUFFVISIBLE, fArcStuffVisible);
|
---|
68 | WinCheckButton(hwnd, CFGA_FOLDERAFTEREXTRACT, fFolderAfterExtract);
|
---|
69 | WinCheckButton(hwnd, CFGA_QUICKARCFIND, fQuickArcFind);
|
---|
70 | WinCheckButton(hwnd, CFGA_DEFARC, (*szDefArc != 0));
|
---|
71 | WinSetDlgItemText(hwnd, CFGA_DEFARCNAME, szDefArc);
|
---|
72 | WinSetDlgItemText(hwnd, CFGA_VIRUS, virus);
|
---|
73 | WinSetDlgItemText(hwnd, CFGA_EXTRACTPATH, extractpath);
|
---|
74 | break;
|
---|
75 |
|
---|
76 | case WM_CONTROL:
|
---|
77 | switch (SHORT1FROMMP(mp1)) {
|
---|
78 | case CFGA_VIRUS:
|
---|
79 | case CFGA_EXTRACTPATH:
|
---|
80 | switch (SHORT2FROMMP(mp1)) {
|
---|
81 | case EN_KILLFOCUS:
|
---|
82 | WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), FALSE);
|
---|
83 | break;
|
---|
84 | case EN_SETFOCUS:
|
---|
85 | WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), TRUE);
|
---|
86 | break;
|
---|
87 | }
|
---|
88 | break;
|
---|
89 | case CFGA_DEFARC:
|
---|
90 | switch (SHORT2FROMMP(mp1)) {
|
---|
91 | case BN_CLICKED:
|
---|
92 | if (WinQueryButtonCheckstate(hwnd, CFGA_DEFARC)) {
|
---|
93 |
|
---|
94 | ARC_TYPE *pat = arcsighead; // Hide dups
|
---|
95 |
|
---|
96 | if (!WinDlgBox(HWND_DESKTOP, hwnd,
|
---|
97 | SBoxDlgProc, FM3ModHandle, ASEL_FRAME,
|
---|
98 | (PVOID) & pat) || !pat || !pat->id || !*pat->id) {
|
---|
99 | DosBeep(250, 100); // Complain
|
---|
100 | WinCheckButton(hwnd, CFGA_DEFARC, FALSE);
|
---|
101 | }
|
---|
102 | else
|
---|
103 | WinSetDlgItemText(hwnd, CFGA_DEFARCNAME, pat->id);
|
---|
104 | }
|
---|
105 | break;
|
---|
106 | default:
|
---|
107 | break;
|
---|
108 | }
|
---|
109 | break;
|
---|
110 |
|
---|
111 | default:
|
---|
112 | break;
|
---|
113 | }
|
---|
114 | return 0;
|
---|
115 |
|
---|
116 | case WM_COMMAND:
|
---|
117 | switch (SHORT1FROMMP(mp1)) {
|
---|
118 | case IDM_UNDO:
|
---|
119 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
120 | break;
|
---|
121 |
|
---|
122 | case DID_CANCEL:
|
---|
123 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
124 |
|
---|
125 | case DID_OK:
|
---|
126 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
127 | break;
|
---|
128 |
|
---|
129 | case IDM_HELP:
|
---|
130 | if (hwndHelp)
|
---|
131 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
132 | MPFROM2SHORT(HELP_CFGA, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
133 | break;
|
---|
134 |
|
---|
135 | case CFGA_FIND:
|
---|
136 | {
|
---|
137 | CHAR filename[CCHMAXPATH + 9];
|
---|
138 | USHORT id;
|
---|
139 | HWND hwndFocus;
|
---|
140 |
|
---|
141 | strcpy(filename, "*.EXE");
|
---|
142 | hwndFocus = WinQueryFocus(HWND_DESKTOP);
|
---|
143 | if (hwndFocus) {
|
---|
144 | id = WinQueryWindowUShort(hwndFocus, QWS_ID);
|
---|
145 | switch (id) {
|
---|
146 | case CFGA_VIRUS:
|
---|
147 | if (insert_filename(hwnd, filename, 2, FALSE) && *filename)
|
---|
148 | WinSetDlgItemText(hwnd, id, filename);
|
---|
149 | break;
|
---|
150 | case CFGA_EXTRACTPATH:
|
---|
151 | strcpy(filename, extractpath);
|
---|
152 | if (WinDlgBox(HWND_DESKTOP, hwndNotebook,
|
---|
153 | WalkExtractDlgProc, FM3ModHandle, WALK_FRAME,
|
---|
154 | MPFROMP(filename)) && *filename)
|
---|
155 | WinSetDlgItemText(hwnd, id, filename);
|
---|
156 | break;
|
---|
157 | default:
|
---|
158 | Runtime_Error(pszSrcFile, __LINE__, "bad case");
|
---|
159 | break;
|
---|
160 | }
|
---|
161 | }
|
---|
162 | }
|
---|
163 | break;
|
---|
164 | }
|
---|
165 | return 0;
|
---|
166 |
|
---|
167 | case WM_CLOSE:
|
---|
168 | fQuickArcFind = WinQueryButtonCheckstate(hwnd, CFGA_QUICKARCFIND);
|
---|
169 | PrfWriteProfileData(fmprof,
|
---|
170 | appname,
|
---|
171 | "QuickArcFind", &fQuickArcFind, sizeof(BOOL));
|
---|
172 | fArcStuffVisible = WinQueryButtonCheckstate(hwnd, CFGA_ARCSTUFFVISIBLE);
|
---|
173 | PrfWriteProfileData(fmprof,
|
---|
174 | appname,
|
---|
175 | "ArcStuffVisible", &fArcStuffVisible, sizeof(BOOL));
|
---|
176 | fFolderAfterExtract = WinQueryButtonCheckstate(hwnd,
|
---|
177 | CFGA_FOLDERAFTEREXTRACT);
|
---|
178 | PrfWriteProfileData(fmprof,
|
---|
179 | appname,
|
---|
180 | "FolderAfterExtract",
|
---|
181 | &fFolderAfterExtract, sizeof(BOOL));
|
---|
182 | if (WinQueryButtonCheckstate(hwnd, CFGA_DEFARC)) {
|
---|
183 |
|
---|
184 | CHAR temp[CCHMAXPATH];
|
---|
185 |
|
---|
186 | *temp = 0;
|
---|
187 | WinQueryDlgItemText(hwnd, CFGA_DEFARCNAME, CCHMAXPATH, temp);
|
---|
188 | strcpy(szDefArc, temp);
|
---|
189 | }
|
---|
190 | else
|
---|
191 | *szDefArc = 0;
|
---|
192 | PrfWriteProfileString(fmprof, appname, "DefArc", szDefArc);
|
---|
193 | WinQueryDlgItemText(hwnd, CFGA_VIRUS, CCHMAXPATH, virus);
|
---|
194 | virus[CCHMAXPATH - 1] = 0;
|
---|
195 | bstrip(virus);
|
---|
196 | if (!*virus)
|
---|
197 | strcpy(virus, "OS2SCAN.EXE %p /SUB /A");
|
---|
198 | WinQueryDlgItemText(hwnd, CFGA_EXTRACTPATH, CCHMAXPATH, extractpath);
|
---|
199 | extractpath[CCHMAXPATH - 1] = 0;
|
---|
200 | bstrip(extractpath);
|
---|
201 | if (*extractpath) {
|
---|
202 | if (strcmp(extractpath, "*")) {
|
---|
203 |
|
---|
204 | MakeFullName(extractpath);
|
---|
205 | if (IsFile(extractpath)) {
|
---|
206 | Runtime_Error(pszSrcFile, __LINE__, "%s not a directory",
|
---|
207 | extractpath);
|
---|
208 | *extractpath = 0;
|
---|
209 | }
|
---|
210 | }
|
---|
211 | }
|
---|
212 | PrfWriteProfileString(fmprof, appname, "Virus", virus);
|
---|
213 | PrfWriteProfileString(fmprof, appname, "ExtractPath", extractpath);
|
---|
214 | break;
|
---|
215 | }
|
---|
216 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
217 | }
|
---|
218 |
|
---|
219 | MRESULT EXPENTRY CfgSDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
220 | {
|
---|
221 | switch (msg) {
|
---|
222 | case WM_INITDLG:
|
---|
223 | WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_SETTEXTLIMIT,
|
---|
224 | MPFROMSHORT(8), MPVOID);
|
---|
225 | WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_OVERRIDESETLIMITS,
|
---|
226 | MPFROMLONG(FILESTOGET_MAX), MPFROMLONG(FILESTOGET_MIN));
|
---|
227 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
228 | break;
|
---|
229 |
|
---|
230 | case UM_UNDO:
|
---|
231 | WinCheckButton(hwnd, CFGS_NOICONSFILES, (fNoIconsFiles == FALSE));
|
---|
232 | WinCheckButton(hwnd, CFGS_NOICONSDIRS, (fNoIconsDirs == FALSE));
|
---|
233 | WinCheckButton(hwnd, CFGS_LOADSUBJECTS, fLoadSubject);
|
---|
234 | WinCheckButton(hwnd, CFGS_LOADLONGNAMES, fLoadLongnames);
|
---|
235 | WinCheckButton(hwnd, CFGS_FORCELOWER, fForceLower);
|
---|
236 | WinCheckButton(hwnd, CFGS_FORCEUPPER, fForceUpper);
|
---|
237 | WinCheckButton(hwnd, CFGS_NOREMOVABLESCAN, fNoRemovableScan);
|
---|
238 | WinCheckButton(hwnd, CFGS_REMOTEBUG, fRemoteBug);
|
---|
239 | WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_SETCURRENTVALUE,
|
---|
240 | MPFROMLONG(FilesToGet), MPVOID);
|
---|
241 | return 0;
|
---|
242 |
|
---|
243 | case WM_CONTROL:
|
---|
244 | switch (SHORT1FROMMP(mp1)) {
|
---|
245 | case CFGS_FORCEUPPER:
|
---|
246 | case CFGS_FORCELOWER:
|
---|
247 | {
|
---|
248 | BOOL temp;
|
---|
249 |
|
---|
250 | temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1));
|
---|
251 | if (temp) {
|
---|
252 | switch (SHORT1FROMMP(mp1)) {
|
---|
253 | case CFGS_FORCEUPPER:
|
---|
254 | WinCheckButton(hwnd, CFGS_FORCELOWER, FALSE);
|
---|
255 | break;
|
---|
256 | case CFGS_FORCELOWER:
|
---|
257 | WinCheckButton(hwnd, CFGS_FORCEUPPER, FALSE);
|
---|
258 | break;
|
---|
259 | }
|
---|
260 | }
|
---|
261 | }
|
---|
262 | break;
|
---|
263 | }
|
---|
264 | return 0;
|
---|
265 |
|
---|
266 | case WM_COMMAND:
|
---|
267 | switch (SHORT1FROMMP(mp1)) {
|
---|
268 | case IDM_UNDO:
|
---|
269 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
270 | break;
|
---|
271 |
|
---|
272 | case DID_CANCEL:
|
---|
273 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
274 |
|
---|
275 | case DID_OK:
|
---|
276 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
277 | break;
|
---|
278 |
|
---|
279 | case IDM_HELP:
|
---|
280 | if (hwndHelp)
|
---|
281 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
282 | MPFROM2SHORT(HELP_CFGS, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
283 | break;
|
---|
284 | }
|
---|
285 | return 0;
|
---|
286 |
|
---|
287 | case WM_CLOSE:
|
---|
288 | fLoadLongnames = WinQueryButtonCheckstate(hwnd, CFGS_LOADLONGNAMES);
|
---|
289 | PrfWriteProfileData(fmprof, appname, "LoadLongname", &fLoadLongnames,
|
---|
290 | sizeof(BOOL));
|
---|
291 | fLoadSubject = WinQueryButtonCheckstate(hwnd, CFGS_LOADSUBJECTS);
|
---|
292 | PrfWriteProfileData(fmprof, appname, "LoadSubject", &fLoadSubject,
|
---|
293 | sizeof(BOOL));
|
---|
294 | fRemoteBug = WinQueryButtonCheckstate(hwnd, CFGS_REMOTEBUG);
|
---|
295 | PrfWriteProfileData(fmprof, appname, "RemoteBug", &fRemoteBug,
|
---|
296 | sizeof(BOOL));
|
---|
297 | fNoRemovableScan = WinQueryButtonCheckstate(hwnd, CFGS_NOREMOVABLESCAN);
|
---|
298 | PrfWriteProfileData(fmprof, FM3Str, "NoRemovableScan", &fNoRemovableScan,
|
---|
299 | sizeof(BOOL));
|
---|
300 | fNoIconsFiles = WinQueryButtonCheckstate(hwnd, CFGS_NOICONSFILES);
|
---|
301 | fNoIconsFiles = (fNoIconsFiles) ? FALSE : TRUE;
|
---|
302 | PrfWriteProfileData(fmprof, appname, "NoIconsFiles",
|
---|
303 | &fNoIconsFiles, sizeof(BOOL));
|
---|
304 | fNoIconsDirs = WinQueryButtonCheckstate(hwnd, CFGS_NOICONSDIRS);
|
---|
305 | fNoIconsDirs = (fNoIconsDirs) ? FALSE : TRUE;
|
---|
306 | PrfWriteProfileData(fmprof, appname, "NoIconsDirs",
|
---|
307 | &fNoIconsDirs, sizeof(BOOL));
|
---|
308 | fForceUpper = WinQueryButtonCheckstate(hwnd, CFGS_FORCEUPPER);
|
---|
309 | PrfWriteProfileData(fmprof, appname, "ForceUpper",
|
---|
310 | &fForceUpper, sizeof(BOOL));
|
---|
311 | fForceLower = WinQueryButtonCheckstate(hwnd, CFGS_FORCELOWER);
|
---|
312 | PrfWriteProfileData(fmprof, appname, "ForceLower",
|
---|
313 | &fForceLower, sizeof(BOOL));
|
---|
314 | {
|
---|
315 | WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_QUERYVALUE,
|
---|
316 | MPFROMP(&FilesToGet), MPFROM2SHORT(0, SPBQ_DONOTUPDATE));
|
---|
317 | if (FilesToGet < FILESTOGET_MIN)
|
---|
318 | FilesToGet = FILESTOGET_MIN;
|
---|
319 | else if (FilesToGet > FILESTOGET_MAX)
|
---|
320 | FilesToGet = FILESTOGET_MAX;
|
---|
321 | PrfWriteProfileData(fmprof,
|
---|
322 | appname, "FilesToGet", &FilesToGet, sizeof(ULONG));
|
---|
323 | }
|
---|
324 | break;
|
---|
325 | }
|
---|
326 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
327 | }
|
---|
328 |
|
---|
329 | MRESULT EXPENTRY CfgVDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
330 | {
|
---|
331 | switch (msg) {
|
---|
332 | case WM_INITDLG:
|
---|
333 | WinSendDlgItemMsg(hwnd, CFGV_VIEWER, EM_SETTEXTLIMIT,
|
---|
334 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
335 | WinSendDlgItemMsg(hwnd, CFGV_EDITOR, EM_SETTEXTLIMIT,
|
---|
336 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
337 | WinSendDlgItemMsg(hwnd, CFGV_BINVIEW, EM_SETTEXTLIMIT,
|
---|
338 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
339 | WinSendDlgItemMsg(hwnd, CFGV_BINED, EM_SETTEXTLIMIT,
|
---|
340 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
341 | WinSendDlgItemMsg(hwnd, CFGV_FTPRUN, EM_SETTEXTLIMIT,
|
---|
342 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
343 | WinSendDlgItemMsg(hwnd, CFGV_HTTPRUN, EM_SETTEXTLIMIT,
|
---|
344 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
345 | WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE);
|
---|
346 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
347 | break;
|
---|
348 |
|
---|
349 | case UM_UNDO:
|
---|
350 | WinSetDlgItemText(hwnd, CFGV_VIEWER, viewer);
|
---|
351 | WinSetDlgItemText(hwnd, CFGV_EDITOR, editor);
|
---|
352 | WinSetDlgItemText(hwnd, CFGV_BINVIEW, binview);
|
---|
353 | WinSetDlgItemText(hwnd, CFGV_BINED, bined);
|
---|
354 | WinSetDlgItemText(hwnd, CFGV_FTPRUN, ftprun);
|
---|
355 | WinSetDlgItemText(hwnd, CFGV_HTTPRUN, httprun);
|
---|
356 | WinCheckButton(hwnd, CFGV_USENEWVIEWER, fUseNewViewer);
|
---|
357 | WinCheckButton(hwnd, CFGV_GUESSTYPE, fGuessType);
|
---|
358 | WinCheckButton(hwnd, CFGV_VIEWCHILD, fViewChild);
|
---|
359 | WinCheckButton(hwnd, CFGV_CHECKMM, fCheckMM);
|
---|
360 | return 0;
|
---|
361 |
|
---|
362 | case WM_CONTROL:
|
---|
363 | switch (SHORT1FROMMP(mp1)) {
|
---|
364 | case CFGV_VIEWER:
|
---|
365 | case CFGV_EDITOR:
|
---|
366 | case CFGV_BINVIEW:
|
---|
367 | case CFGV_BINED:
|
---|
368 | case CFGV_HTTPRUN:
|
---|
369 | case CFGV_FTPRUN:
|
---|
370 | switch (SHORT2FROMMP(mp1)) {
|
---|
371 | case EN_KILLFOCUS:
|
---|
372 | WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE);
|
---|
373 | break;
|
---|
374 | case EN_SETFOCUS:
|
---|
375 | WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), TRUE);
|
---|
376 | break;
|
---|
377 | }
|
---|
378 | break;
|
---|
379 | }
|
---|
380 | return 0;
|
---|
381 |
|
---|
382 | case WM_COMMAND:
|
---|
383 | switch (SHORT1FROMMP(mp1)) {
|
---|
384 | case IDM_UNDO:
|
---|
385 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
386 | break;
|
---|
387 |
|
---|
388 | case DID_CANCEL:
|
---|
389 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
390 |
|
---|
391 | case DID_OK:
|
---|
392 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
393 | break;
|
---|
394 |
|
---|
395 | case IDM_HELP:
|
---|
396 | if (hwndHelp)
|
---|
397 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
398 | MPFROM2SHORT(HELP_CFGV, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
399 | break;
|
---|
400 |
|
---|
401 | case CFGV_FIND:
|
---|
402 | {
|
---|
403 | CHAR filename[CCHMAXPATH + 9];
|
---|
404 | USHORT id;
|
---|
405 | HWND hwndFocus;
|
---|
406 |
|
---|
407 | strcpy(filename, "*.EXE");
|
---|
408 | hwndFocus = WinQueryFocus(HWND_DESKTOP);
|
---|
409 | if (hwndFocus) {
|
---|
410 | id = WinQueryWindowUShort(hwndFocus, QWS_ID);
|
---|
411 | switch (id) {
|
---|
412 | case CFGV_BINVIEW:
|
---|
413 | case CFGV_BINED:
|
---|
414 | case CFGV_VIEWER:
|
---|
415 | case CFGV_EDITOR:
|
---|
416 | if (insert_filename(hwnd, filename, 2, FALSE) && *filename) {
|
---|
417 | strcat(filename, " %a");
|
---|
418 | WinSetDlgItemText(hwnd, id, filename);
|
---|
419 | }
|
---|
420 | break;
|
---|
421 | case CFGV_HTTPRUN:
|
---|
422 | case CFGV_FTPRUN:
|
---|
423 | if (insert_filename(hwnd, filename, 2, FALSE) && *filename)
|
---|
424 | WinSetDlgItemText(hwnd, id, filename);
|
---|
425 | break;
|
---|
426 | default:
|
---|
427 | Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id);
|
---|
428 | break;
|
---|
429 | }
|
---|
430 | }
|
---|
431 | }
|
---|
432 | break;
|
---|
433 | }
|
---|
434 | return 0;
|
---|
435 |
|
---|
436 | case WM_CLOSE:
|
---|
437 | WinQueryDlgItemText(hwnd, CFGV_VIEWER, CCHMAXPATH, viewer);
|
---|
438 | viewer[CCHMAXPATH - 1] = 0;
|
---|
439 | bstrip(viewer);
|
---|
440 | WinQueryDlgItemText(hwnd, CFGV_EDITOR, CCHMAXPATH, editor);
|
---|
441 | editor[CCHMAXPATH - 1] = 0;
|
---|
442 | bstrip(editor);
|
---|
443 | WinQueryDlgItemText(hwnd, CFGV_BINVIEW, CCHMAXPATH, binview);
|
---|
444 | binview[CCHMAXPATH - 1] = 0;
|
---|
445 | bstrip(binview);
|
---|
446 | WinQueryDlgItemText(hwnd, CFGV_BINED, CCHMAXPATH, bined);
|
---|
447 | bined[CCHMAXPATH - 1] = 0;
|
---|
448 | bstrip(bined);
|
---|
449 | WinQueryDlgItemText(hwnd, CFGV_FTPRUN, CCHMAXPATH, ftprun);
|
---|
450 | ftprun[CCHMAXPATH - 1] = 0;
|
---|
451 | bstrip(ftprun);
|
---|
452 | WinQueryDlgItemText(hwnd, CFGV_HTTPRUN, CCHMAXPATH, httprun);
|
---|
453 | httprun[CCHMAXPATH - 1] = 0;
|
---|
454 | bstrip(httprun);
|
---|
455 | PrfWriteProfileString(fmprof, appname, "Viewer", viewer);
|
---|
456 | PrfWriteProfileString(fmprof, appname, "Editor", editor);
|
---|
457 | PrfWriteProfileString(fmprof, appname, "BinView", binview);
|
---|
458 | PrfWriteProfileString(fmprof, appname, "BinEd", bined);
|
---|
459 | PrfWriteProfileString(fmprof, appname, "FTPRun", ftprun);
|
---|
460 | PrfWriteProfileString(fmprof, appname, "HTTPRun", httprun);
|
---|
461 | fUseNewViewer = WinQueryButtonCheckstate(hwnd, CFGV_USENEWVIEWER);
|
---|
462 | PrfWriteProfileData(fmprof, appname, "UseNewViewer", &fUseNewViewer,
|
---|
463 | sizeof(BOOL));
|
---|
464 | fGuessType = WinQueryButtonCheckstate(hwnd, CFGV_GUESSTYPE);
|
---|
465 | PrfWriteProfileData(fmprof, appname, "GuessType", &fGuessType,
|
---|
466 | sizeof(BOOL));
|
---|
467 | fViewChild = WinQueryButtonCheckstate(hwnd, CFGV_VIEWCHILD);
|
---|
468 | PrfWriteProfileData(fmprof, appname, "ViewChild", &fViewChild,
|
---|
469 | sizeof(BOOL));
|
---|
470 | fCheckMM = WinQueryButtonCheckstate(hwnd, CFGV_CHECKMM);
|
---|
471 | PrfWriteProfileData(fmprof, appname, "CheckMM", &fCheckMM, sizeof(BOOL));
|
---|
472 | break;
|
---|
473 | }
|
---|
474 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
475 | }
|
---|
476 |
|
---|
477 | MRESULT EXPENTRY CfgBDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
478 | {
|
---|
479 | switch (msg) {
|
---|
480 | case WM_INITDLG:
|
---|
481 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
482 | break;
|
---|
483 |
|
---|
484 | case UM_UNDO:
|
---|
485 | WinCheckButton(hwnd, CFGB_TOOLBARHELP, fToolbarHelp);
|
---|
486 | WinCheckButton(hwnd, CFGB_DRIVEBARHELP, fDrivebarHelp);
|
---|
487 | WinCheckButton(hwnd, CFGB_OTHERHELP, fOtherHelp);
|
---|
488 | return 0;
|
---|
489 |
|
---|
490 | case WM_COMMAND:
|
---|
491 | switch (SHORT1FROMMP(mp1)) {
|
---|
492 | case IDM_UNDO:
|
---|
493 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
494 | break;
|
---|
495 |
|
---|
496 | case DID_CANCEL:
|
---|
497 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
498 |
|
---|
499 | case DID_OK:
|
---|
500 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
501 | break;
|
---|
502 |
|
---|
503 | case IDM_HELP:
|
---|
504 | if (hwndHelp)
|
---|
505 | WinSendMsg(hwndHelp,
|
---|
506 | HM_DISPLAY_HELP,
|
---|
507 | MPFROM2SHORT(HELP_CFGB, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
508 | break;
|
---|
509 | }
|
---|
510 | return 0;
|
---|
511 |
|
---|
512 | case WM_CLOSE:
|
---|
513 | fToolbarHelp = WinQueryButtonCheckstate(hwnd, CFGB_TOOLBARHELP);
|
---|
514 | PrfWriteProfileData(fmprof,
|
---|
515 | FM3Str, "ToolbarHelp", &fToolbarHelp, sizeof(BOOL));
|
---|
516 | fDrivebarHelp = WinQueryButtonCheckstate(hwnd, CFGB_DRIVEBARHELP);
|
---|
517 | PrfWriteProfileData(fmprof,
|
---|
518 | FM3Str, "DrivebarHelp", &fDrivebarHelp, sizeof(BOOL));
|
---|
519 | fOtherHelp = WinQueryButtonCheckstate(hwnd, CFGB_OTHERHELP);
|
---|
520 | PrfWriteProfileData(fmprof,
|
---|
521 | FM3Str, "OtherHelp", &fOtherHelp, sizeof(BOOL));
|
---|
522 | break;
|
---|
523 | }
|
---|
524 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
525 | }
|
---|
526 |
|
---|
527 | MRESULT EXPENTRY CfgTSDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
528 | {
|
---|
529 | static MASK mask;
|
---|
530 |
|
---|
531 | switch (msg) {
|
---|
532 | case WM_INITDLG:
|
---|
533 | WinSendDlgItemMsg(hwnd,
|
---|
534 | CFG5_FILTER,
|
---|
535 | EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
536 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
537 | break;
|
---|
538 |
|
---|
539 | case UM_FOCUSME:
|
---|
540 | WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, IDM_HELP));
|
---|
541 | return 0;
|
---|
542 |
|
---|
543 | case UM_UNDO:
|
---|
544 | {
|
---|
545 | ULONG flWindowAttr = 0, size = sizeof(ULONG);
|
---|
546 |
|
---|
547 | if (!PrfQueryProfileData(fmprof,
|
---|
548 | appname,
|
---|
549 | "TreeflWindowAttr",
|
---|
550 | (PVOID) & flWindowAttr, &size))
|
---|
551 | flWindowAttr |= (CV_TREE | CA_TREELINE | CV_ICON | CV_MINI | CV_FLOW);
|
---|
552 | WinCheckButton(hwnd, CFG5_ICON, ((flWindowAttr & CV_ICON) != FALSE));
|
---|
553 | WinCheckButton(hwnd, CFG5_MINIICONS,
|
---|
554 | ((flWindowAttr & CV_MINI) != FALSE));
|
---|
555 | memset(&mask, 0, sizeof(mask));
|
---|
556 | mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN |
|
---|
557 | FILE_SYSTEM | FILE_NORMAL | FILE_READONLY;
|
---|
558 | mask.fIsTree = TRUE;
|
---|
559 | size = sizeof(MASK);
|
---|
560 | if (PrfQueryProfileData(fmprof, appname, "TreeFilter", &mask, &size)) {
|
---|
561 | SetMask(NULL, &mask);
|
---|
562 | }
|
---|
563 | if (!mask.attrFile)
|
---|
564 | mask.attrFile = (FILE_READONLY | FILE_NORMAL |
|
---|
565 | FILE_ARCHIVED | FILE_DIRECTORY |
|
---|
566 | FILE_HIDDEN | FILE_SYSTEM);
|
---|
567 | strcpy(mask.prompt, GetPString(IDS_TREEFILTERTITLETEXT));
|
---|
568 | WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask);
|
---|
569 | WinCheckButton(hwnd, CFG6_SORTFIRST, FALSE);
|
---|
570 | WinCheckButton(hwnd, CFG6_SORTLAST, FALSE);
|
---|
571 | WinCheckButton(hwnd, CFG6_SORTSIZE, FALSE);
|
---|
572 | WinCheckButton(hwnd, CFG6_SORTEASIZE, FALSE);
|
---|
573 | WinCheckButton(hwnd, CFG6_SORTLWDATE, FALSE);
|
---|
574 | WinCheckButton(hwnd, CFG6_SORTLADATE, FALSE);
|
---|
575 | WinCheckButton(hwnd, CFG6_SORTCRDATE, FALSE);
|
---|
576 | WinCheckButton(hwnd, CFG6_SORTNAME, FALSE);
|
---|
577 | WinCheckButton(hwnd, CFG6_SORTREVERSE, FALSE);
|
---|
578 | if (TreesortFlags & SORT_FIRSTEXTENSION)
|
---|
579 | WinCheckButton(hwnd, CFG6_SORTFIRST, TRUE);
|
---|
580 | else if (TreesortFlags & SORT_LASTEXTENSION)
|
---|
581 | WinCheckButton(hwnd, CFG6_SORTLAST, TRUE);
|
---|
582 | else if (TreesortFlags & SORT_SIZE)
|
---|
583 | WinCheckButton(hwnd, CFG6_SORTSIZE, TRUE);
|
---|
584 | else if (TreesortFlags & SORT_EASIZE)
|
---|
585 | WinCheckButton(hwnd, CFG6_SORTEASIZE, TRUE);
|
---|
586 | else if (TreesortFlags & SORT_LWDATE)
|
---|
587 | WinCheckButton(hwnd, CFG6_SORTLWDATE, TRUE);
|
---|
588 | else if (TreesortFlags & SORT_LADATE)
|
---|
589 | WinCheckButton(hwnd, CFG6_SORTLADATE, TRUE);
|
---|
590 | else if (TreesortFlags & SORT_CRDATE)
|
---|
591 | WinCheckButton(hwnd, CFG6_SORTCRDATE, TRUE);
|
---|
592 | else if (TreesortFlags & SORT_FILENAME)
|
---|
593 | WinCheckButton(hwnd, CFG6_SORTFILENAME, TRUE);
|
---|
594 | else
|
---|
595 | WinCheckButton(hwnd, CFG6_SORTNAME, TRUE);
|
---|
596 | if (TreesortFlags & SORT_REVERSE)
|
---|
597 | WinCheckButton(hwnd, CFG6_SORTREVERSE, TRUE);
|
---|
598 | }
|
---|
599 | return 0;
|
---|
600 |
|
---|
601 | case UM_SETUP5:
|
---|
602 | if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc,
|
---|
603 | FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) {
|
---|
604 | SetMask(NULL, &mask);
|
---|
605 | WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask);
|
---|
606 | }
|
---|
607 | return 0;
|
---|
608 |
|
---|
609 | case WM_CONTROL:
|
---|
610 | switch (SHORT1FROMMP(mp1)) {
|
---|
611 | case CFG5_FILTER:
|
---|
612 | switch (SHORT2FROMMP(mp1)) {
|
---|
613 | case EN_SETFOCUS:
|
---|
614 | PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);
|
---|
615 | PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID);
|
---|
616 | break;
|
---|
617 | }
|
---|
618 | break;
|
---|
619 | }
|
---|
620 | return 0;
|
---|
621 |
|
---|
622 | case WM_COMMAND:
|
---|
623 | switch (SHORT1FROMMP(mp1)) {
|
---|
624 | case IDM_UNDO:
|
---|
625 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
626 | break;
|
---|
627 |
|
---|
628 | case DID_CANCEL:
|
---|
629 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
630 |
|
---|
631 | case DID_OK:
|
---|
632 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
633 | break;
|
---|
634 |
|
---|
635 | case IDM_HELP:
|
---|
636 | if (hwndHelp)
|
---|
637 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
638 | MPFROM2SHORT(HELP_TREEVIEW, 0),
|
---|
639 | MPFROMSHORT(HM_RESOURCEID));
|
---|
640 | break;
|
---|
641 | }
|
---|
642 | return 0;
|
---|
643 |
|
---|
644 | case WM_CLOSE:
|
---|
645 | {
|
---|
646 | ULONG flWindowAttr = 0;
|
---|
647 |
|
---|
648 | if (WinQueryButtonCheckstate(hwnd, CFG5_ICON))
|
---|
649 | flWindowAttr |= CV_ICON;
|
---|
650 | else
|
---|
651 | flWindowAttr |= CV_TEXT;
|
---|
652 | if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS))
|
---|
653 | flWindowAttr |= CV_MINI;
|
---|
654 | flWindowAttr |= (CV_TREE | CV_FLOW | CA_TREELINE);
|
---|
655 | PrfWriteProfileData(fmprof,
|
---|
656 | appname,
|
---|
657 | "TreeflWindowAttr", &flWindowAttr, sizeof(ULONG));
|
---|
658 | if (hwndTree) {
|
---|
659 |
|
---|
660 | CNRINFO cnri;
|
---|
661 |
|
---|
662 | memset(&cnri, 0, sizeof(cnri));
|
---|
663 | cnri.cb = sizeof(cnri);
|
---|
664 | WinSendMsg(WinWindowFromID
|
---|
665 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
666 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
667 | cnri.flWindowAttr = flWindowAttr;
|
---|
668 | WinSendMsg(WinWindowFromID
|
---|
669 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
670 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
671 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
672 | }
|
---|
673 | }
|
---|
674 | TreesortFlags = 0;
|
---|
675 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTFILENAME))
|
---|
676 | TreesortFlags |= SORT_FILENAME;
|
---|
677 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTSIZE))
|
---|
678 | TreesortFlags |= SORT_SIZE;
|
---|
679 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTEASIZE))
|
---|
680 | TreesortFlags |= SORT_EASIZE;
|
---|
681 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTFIRST))
|
---|
682 | TreesortFlags |= SORT_FIRSTEXTENSION;
|
---|
683 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLAST))
|
---|
684 | TreesortFlags |= SORT_LASTEXTENSION;
|
---|
685 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLWDATE))
|
---|
686 | TreesortFlags |= SORT_LWDATE;
|
---|
687 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLADATE))
|
---|
688 | TreesortFlags |= SORT_LADATE;
|
---|
689 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTCRDATE))
|
---|
690 | TreesortFlags |= SORT_CRDATE;
|
---|
691 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTDIRSFIRST))
|
---|
692 | TreesortFlags |= SORT_DIRSFIRST;
|
---|
693 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTDIRSLAST))
|
---|
694 | TreesortFlags |= SORT_DIRSLAST;
|
---|
695 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTREVERSE))
|
---|
696 | TreesortFlags |= SORT_REVERSE;
|
---|
697 | PrfWriteProfileData(fmprof, appname, "TreeSort", &TreesortFlags,
|
---|
698 | sizeof(INT));
|
---|
699 | if (hwndTree)
|
---|
700 | PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESORT, 0), MPVOID);
|
---|
701 | *mask.prompt = 0;
|
---|
702 | PrfWriteProfileData(fmprof, appname, "TreeFilter", &mask, sizeof(MASK));
|
---|
703 | if (hwndTree) {
|
---|
704 |
|
---|
705 | DIRCNRDATA *dcd;
|
---|
706 |
|
---|
707 | dcd = WinQueryWindowPtr(WinWindowFromID(WinWindowFromID(hwndTree,
|
---|
708 | FID_CLIENT),
|
---|
709 | TREE_CNR), QWL_USER);
|
---|
710 | if (dcd && dcd->size == sizeof(DIRCNRDATA)) {
|
---|
711 | dcd->mask = mask;
|
---|
712 | PostMsg(hwndTree, UM_FILTER, MPVOID, MPVOID);
|
---|
713 | }
|
---|
714 | }
|
---|
715 | break;
|
---|
716 | }
|
---|
717 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
718 | }
|
---|
719 |
|
---|
720 | MRESULT EXPENTRY CfgTDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
721 | {
|
---|
722 | switch (msg) {
|
---|
723 | case WM_INITDLG:
|
---|
724 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
725 | break;
|
---|
726 |
|
---|
727 | case UM_UNDO:
|
---|
728 | WinCheckButton(hwnd, CFGT_FOLLOWTREE, fFollowTree);
|
---|
729 | WinCheckButton(hwnd, CFGT_TOPDIR, fTopDir);
|
---|
730 | WinCheckButton(hwnd, CFGT_DCOPENS, fDCOpens);
|
---|
731 | WinCheckButton(hwnd, CFGT_VTREEOPENSWPS, fVTreeOpensWPS);
|
---|
732 | WinCheckButton(hwnd, CFGT_COLLAPSEFIRST, fCollapseFirst);
|
---|
733 | WinCheckButton(hwnd, CFGT_SWITCHTREEONFOCUS, fSwitchTreeOnFocus);
|
---|
734 | WinCheckButton(hwnd, CFGT_SWITCHTREE, fSwitchTree);
|
---|
735 | WinCheckButton(hwnd, CFGT_SWITCHTREEEXPAND, fSwitchTreeExpand);
|
---|
736 | WinCheckButton(hwnd, CFGT_SHOWENV, fShowEnv);
|
---|
737 | return 0;
|
---|
738 |
|
---|
739 | case WM_COMMAND:
|
---|
740 | switch (SHORT1FROMMP(mp1)) {
|
---|
741 | case IDM_UNDO:
|
---|
742 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
743 | break;
|
---|
744 |
|
---|
745 | case DID_CANCEL:
|
---|
746 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
747 |
|
---|
748 | case DID_OK:
|
---|
749 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
750 | break;
|
---|
751 |
|
---|
752 | case IDM_HELP:
|
---|
753 | if (hwndHelp)
|
---|
754 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
755 | MPFROM2SHORT(HELP_CFGT, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
756 | break;
|
---|
757 | }
|
---|
758 | return 0;
|
---|
759 |
|
---|
760 | case WM_CLOSE:
|
---|
761 | fVTreeOpensWPS = WinQueryButtonCheckstate(hwnd, CFGT_VTREEOPENSWPS);
|
---|
762 | PrfWriteProfileData(fmprof, FM3Str, "VTreeOpensWPS", &fVTreeOpensWPS,
|
---|
763 | sizeof(BOOL));
|
---|
764 | fCollapseFirst = WinQueryButtonCheckstate(hwnd, CFGT_COLLAPSEFIRST);
|
---|
765 | PrfWriteProfileData(fmprof, appname, "CollapseFirst", &fCollapseFirst,
|
---|
766 | sizeof(BOOL));
|
---|
767 | fSwitchTreeOnFocus = WinQueryButtonCheckstate(hwnd,
|
---|
768 | CFGT_SWITCHTREEONFOCUS);
|
---|
769 | PrfWriteProfileData(fmprof, appname, "SwitchTreeOnFocus",
|
---|
770 | &fSwitchTreeOnFocus, sizeof(BOOL));
|
---|
771 | fSwitchTreeExpand = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREEEXPAND);
|
---|
772 | PrfWriteProfileData(fmprof, appname, "SwitchTreeExpand",
|
---|
773 | &fSwitchTreeExpand, sizeof(BOOL));
|
---|
774 | fSwitchTree = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREE);
|
---|
775 | PrfWriteProfileData(fmprof, appname, "SwitchTree", &fSwitchTree,
|
---|
776 | sizeof(BOOL));
|
---|
777 | fFollowTree = WinQueryButtonCheckstate(hwnd, CFGT_FOLLOWTREE);
|
---|
778 | PrfWriteProfileData(fmprof, appname, "FollowTree", &fFollowTree,
|
---|
779 | sizeof(BOOL));
|
---|
780 | fTopDir = WinQueryButtonCheckstate(hwnd, CFGT_TOPDIR);
|
---|
781 | PrfWriteProfileData(fmprof, appname, "TopDir", (PVOID) & fTopDir,
|
---|
782 | sizeof(BOOL));
|
---|
783 | fDCOpens = WinQueryButtonCheckstate(hwnd, CFGT_DCOPENS);
|
---|
784 | PrfWriteProfileData(fmprof, FM3Str, "DoubleClickOpens", &fDCOpens,
|
---|
785 | sizeof(BOOL));
|
---|
786 | if (hwndTree && fShowEnv != WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV))
|
---|
787 | PostMsg(WinWindowFromID
|
---|
788 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), WM_COMMAND,
|
---|
789 | MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
|
---|
790 | fShowEnv = WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV);
|
---|
791 | PrfWriteProfileData(fmprof, appname, "ShowEnv", &fShowEnv, sizeof(BOOL));
|
---|
792 | break;
|
---|
793 | }
|
---|
794 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
795 | }
|
---|
796 |
|
---|
797 | MRESULT EXPENTRY CfgGDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
798 | {
|
---|
799 | switch (msg) {
|
---|
800 | case WM_INITDLG:
|
---|
801 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
802 | break;
|
---|
803 |
|
---|
804 | case UM_UNDO:
|
---|
805 | WinCheckButton(hwnd, CFGG_CONFIRMDELETE, fConfirmDelete);
|
---|
806 | WinCheckButton(hwnd, CFGG_VERIFYWRITES, fVerify);
|
---|
807 | WinCheckButton(hwnd, CFGG_LINKSETSICON, fLinkSetsIcon);
|
---|
808 | WinCheckButton(hwnd, CFGG_DONTMOVEMOUSE, fDontMoveMouse);
|
---|
809 | WinCheckButton(hwnd, CFGG_DEFAULTCOPY, fCopyDefault);
|
---|
810 | WinCheckButton(hwnd, CFGG_IDLECOPY, fRealIdle);
|
---|
811 | WinCheckButton(hwnd, CFGG_DNDDLG, fDragndropDlg);
|
---|
812 | WinCheckButton(hwnd, CFGG_DEFAULTDELETEPERM, fDefaultDeletePerm);
|
---|
813 | {
|
---|
814 | long th = fNoFinger ? 2 : (fNoDead ? 1 : 0);
|
---|
815 | WinCheckButton(hwnd, CFGG_NODEAD, th);
|
---|
816 | }
|
---|
817 | WinCheckButton(hwnd, CFGG_BORING, fDullMin);
|
---|
818 | WinCheckButton(hwnd, CFGG_CUSTOMFILEDLG, fCustomFileDlg);
|
---|
819 | WinCheckButton(hwnd, CFGG_FM2DELETES, fFM2Deletes);
|
---|
820 | WinCheckButton(hwnd, CFGG_CONFIRMTARGET, fConfirmTarget);
|
---|
821 | WinSetDlgItemText(hwnd, CFGG_TARGETDIR, targetdir);
|
---|
822 | return 0;
|
---|
823 |
|
---|
824 | case UM_FOCUSME:
|
---|
825 | WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, IDM_HELP));
|
---|
826 | return 0;
|
---|
827 |
|
---|
828 | case UM_SETUP5:
|
---|
829 | SetTargetDir(hwnd, FALSE);
|
---|
830 | WinSetDlgItemText(hwnd, CFGG_TARGETDIR, targetdir);
|
---|
831 | return 0;
|
---|
832 |
|
---|
833 | case WM_CONTROL:
|
---|
834 | switch (SHORT1FROMMP(mp1)) {
|
---|
835 | case CFGG_TARGETDIR:
|
---|
836 | switch (SHORT2FROMMP(mp1)) {
|
---|
837 | case EN_SETFOCUS:
|
---|
838 | PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);
|
---|
839 | PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID);
|
---|
840 | break;
|
---|
841 | }
|
---|
842 | break;
|
---|
843 | }
|
---|
844 | return 0;
|
---|
845 |
|
---|
846 | case WM_COMMAND:
|
---|
847 | switch (SHORT1FROMMP(mp1)) {
|
---|
848 | case IDM_UNDO:
|
---|
849 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
850 | break;
|
---|
851 |
|
---|
852 | case DID_CANCEL:
|
---|
853 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
854 |
|
---|
855 | case DID_OK:
|
---|
856 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
857 | break;
|
---|
858 |
|
---|
859 | case IDM_HELP:
|
---|
860 | if (hwndHelp)
|
---|
861 | WinSendMsg(hwndHelp,
|
---|
862 | HM_DISPLAY_HELP,
|
---|
863 | MPFROM2SHORT(HELP_CFGG, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
864 | break;
|
---|
865 | }
|
---|
866 | return 0;
|
---|
867 |
|
---|
868 | case WM_CLOSE:
|
---|
869 | {
|
---|
870 | long test;
|
---|
871 |
|
---|
872 | test = WinQueryButtonCheckstate(hwnd, CFGG_NODEAD);
|
---|
873 | fNoDead = (test == 1);
|
---|
874 | fNoFinger = (test == 2);
|
---|
875 | PrfWriteProfileData(fmprof, FM3Str, "NoDead", &fNoDead, sizeof(BOOL));
|
---|
876 | PrfWriteProfileData(fmprof,
|
---|
877 | FM3Str, "NoFinger", &fNoFinger, sizeof(BOOL));
|
---|
878 | WinDestroyPointer(hptrFinger);
|
---|
879 | if (!fNoDead)
|
---|
880 | hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER_ICON);
|
---|
881 | else
|
---|
882 | hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER2_ICON);
|
---|
883 | }
|
---|
884 | fLinkSetsIcon = WinQueryButtonCheckstate(hwnd, CFGG_LINKSETSICON);
|
---|
885 | PrfWriteProfileData(fmprof,
|
---|
886 | appname,
|
---|
887 | "LinkSetsIcon", &fLinkSetsIcon, sizeof(BOOL));
|
---|
888 | fCustomFileDlg = WinQueryButtonCheckstate(hwnd, CFGG_CUSTOMFILEDLG);
|
---|
889 | PrfWriteProfileData(fmprof,
|
---|
890 | FM3Str,
|
---|
891 | "CustomFileDlg", &fCustomFileDlg, sizeof(BOOL));
|
---|
892 | fDullMin = WinQueryButtonCheckstate(hwnd, CFGG_BORING);
|
---|
893 | PrfWriteProfileData(fmprof,
|
---|
894 | FM3Str, "DullDatabar", &fDullMin, sizeof(BOOL));
|
---|
895 | fConfirmDelete = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMDELETE);
|
---|
896 | PrfWriteProfileData(fmprof,
|
---|
897 | appname,
|
---|
898 | "ConfirmDelete", &fConfirmDelete, sizeof(BOOL));
|
---|
899 | fDontMoveMouse = WinQueryButtonCheckstate(hwnd, CFGG_DONTMOVEMOUSE);
|
---|
900 | PrfWriteProfileData(fmprof,
|
---|
901 | appname,
|
---|
902 | "DontMoveMouse", &fDontMoveMouse, sizeof(BOOL));
|
---|
903 | fCopyDefault = WinQueryButtonCheckstate(hwnd, CFGG_DEFAULTCOPY);
|
---|
904 | PrfWriteProfileData(fmprof, appname, "DefaultCopy",
|
---|
905 | &fCopyDefault, sizeof(BOOL));
|
---|
906 | fRealIdle = WinQueryButtonCheckstate(hwnd, CFGG_IDLECOPY);
|
---|
907 | PrfWriteProfileData(fmprof, appname, "IdleCopy",
|
---|
908 | &fRealIdle, sizeof(BOOL));
|
---|
909 | fDragndropDlg = WinQueryButtonCheckstate(hwnd, CFGG_DNDDLG);
|
---|
910 | PrfWriteProfileData(fmprof, appname, "Drag&DropDlg",
|
---|
911 | &fDragndropDlg, sizeof(BOOL));
|
---|
912 | fVerify = WinQueryButtonCheckstate(hwnd, CFGG_VERIFYWRITES);
|
---|
913 | PrfWriteProfileData(fmprof, appname, "VerifyWrites",
|
---|
914 | &fVerify, sizeof(BOOL));
|
---|
915 | DosSetVerify(fVerify);
|
---|
916 | fDefaultDeletePerm = WinQueryButtonCheckstate(hwnd,
|
---|
917 | CFGG_DEFAULTDELETEPERM);
|
---|
918 | PrfWriteProfileData(fmprof, appname, "DefaultDeletePerm",
|
---|
919 | &fDefaultDeletePerm, sizeof(BOOL));
|
---|
920 | fFM2Deletes = WinQueryButtonCheckstate(hwnd, CFGG_FM2DELETES);
|
---|
921 | PrfWriteProfileData(fmprof, FM3Str, "FM2Deletes",
|
---|
922 | &fFM2Deletes, sizeof(BOOL));
|
---|
923 | fConfirmTarget = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMTARGET);
|
---|
924 | PrfWriteProfileData(fmprof, appname, "ConfirmTarget",
|
---|
925 | &fConfirmTarget, sizeof(BOOL));
|
---|
926 | break;
|
---|
927 | }
|
---|
928 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
929 | }
|
---|
930 |
|
---|
931 | MRESULT EXPENTRY CfgCDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
932 | {
|
---|
933 | switch (msg) {
|
---|
934 | case WM_INITDLG:
|
---|
935 | WinSendDlgItemMsg(hwnd, CFGC_COMPARE, EM_SETTEXTLIMIT,
|
---|
936 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
937 | WinSendDlgItemMsg(hwnd, CFGC_DIRCOMPARE, EM_SETTEXTLIMIT,
|
---|
938 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
939 | WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), FALSE);
|
---|
940 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
941 | break;
|
---|
942 |
|
---|
943 | case UM_UNDO:
|
---|
944 | WinSetDlgItemText(hwnd, CFGC_COMPARE, compare);
|
---|
945 | WinSetDlgItemText(hwnd, CFGC_DIRCOMPARE, dircompare);
|
---|
946 | return 0;
|
---|
947 |
|
---|
948 | case WM_CONTROL:
|
---|
949 | switch (SHORT1FROMMP(mp1)) {
|
---|
950 | case CFGC_COMPARE:
|
---|
951 | case CFGC_DIRCOMPARE:
|
---|
952 | switch (SHORT2FROMMP(mp1)) {
|
---|
953 | case EN_KILLFOCUS:
|
---|
954 | WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), FALSE);
|
---|
955 | break;
|
---|
956 | case EN_SETFOCUS:
|
---|
957 | WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), TRUE);
|
---|
958 | break;
|
---|
959 | }
|
---|
960 | break;
|
---|
961 | }
|
---|
962 | return 0;
|
---|
963 |
|
---|
964 | case WM_COMMAND:
|
---|
965 | switch (SHORT1FROMMP(mp1)) {
|
---|
966 | case IDM_UNDO:
|
---|
967 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
968 | break;
|
---|
969 |
|
---|
970 | case DID_CANCEL:
|
---|
971 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
972 |
|
---|
973 | case DID_OK:
|
---|
974 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
975 | break;
|
---|
976 |
|
---|
977 | case IDM_HELP:
|
---|
978 | if (hwndHelp)
|
---|
979 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
980 | MPFROM2SHORT(HELP_CFGC, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
981 | break;
|
---|
982 |
|
---|
983 | case CFGC_FIND:
|
---|
984 | {
|
---|
985 | CHAR filename[CCHMAXPATH + 9];
|
---|
986 | USHORT id;
|
---|
987 | HWND hwndFocus;
|
---|
988 |
|
---|
989 | strcpy(filename, "*.EXE");
|
---|
990 | hwndFocus = WinQueryFocus(HWND_DESKTOP);
|
---|
991 | if (hwndFocus) {
|
---|
992 | id = WinQueryWindowUShort(hwndFocus, QWS_ID);
|
---|
993 | switch (id) {
|
---|
994 | case CFGC_COMPARE:
|
---|
995 | case CFGC_DIRCOMPARE:
|
---|
996 | if (insert_filename(hwnd, filename, 2, FALSE) && *filename) {
|
---|
997 | strcat(filename, " %a");
|
---|
998 | WinSetDlgItemText(hwnd, id, filename);
|
---|
999 | }
|
---|
1000 | break;
|
---|
1001 | default:
|
---|
1002 | Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id);
|
---|
1003 | break;
|
---|
1004 | }
|
---|
1005 | }
|
---|
1006 | }
|
---|
1007 | break;
|
---|
1008 | }
|
---|
1009 | return 0;
|
---|
1010 |
|
---|
1011 | case WM_CLOSE:
|
---|
1012 | WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, CCHMAXPATH, dircompare);
|
---|
1013 | dircompare[CCHMAXPATH - 1] = 0;
|
---|
1014 | bstrip(dircompare);
|
---|
1015 | PrfWriteProfileString(fmprof, appname, "DirCompare", dircompare);
|
---|
1016 | WinQueryDlgItemText(hwnd, CFGC_COMPARE, CCHMAXPATH, compare);
|
---|
1017 | compare[CCHMAXPATH - 1] = 0;
|
---|
1018 | bstrip(compare);
|
---|
1019 | PrfWriteProfileString(fmprof, appname, "Compare", compare);
|
---|
1020 | break;
|
---|
1021 | }
|
---|
1022 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
1023 | }
|
---|
1024 |
|
---|
1025 | MRESULT EXPENTRY CfgDDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
1026 | {
|
---|
1027 | switch (msg) {
|
---|
1028 | case WM_INITDLG:
|
---|
1029 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1030 | break;
|
---|
1031 |
|
---|
1032 | case UM_UNDO:
|
---|
1033 | WinCheckButton(hwnd, CFGD_UNHILITE, fUnHilite);
|
---|
1034 | WinCheckButton(hwnd, CFGD_SYNCUPDATES, fSyncUpdates);
|
---|
1035 | WinCheckButton(hwnd, CFGD_LOOKINDIR, fLookInDir);
|
---|
1036 | WinCheckButton(hwnd, CFGD_MINONOPEN, fMinOnOpen);
|
---|
1037 | WinCheckButton(hwnd, CFGD_SELECTEDALWAYS, fSelectedAlways);
|
---|
1038 | WinCheckButton(hwnd, CFGD_NOSEARCH, fNoSearch);
|
---|
1039 | WinCheckButton(hwnd, CFGD_EXTENDEDSEL,
|
---|
1040 | ((ulCnrType & CCS_EXTENDSEL) != 0));
|
---|
1041 | WinCheckButton(hwnd, CFGD_MULTIPLESEL,
|
---|
1042 | ((ulCnrType & CCS_MULTIPLESEL) != 0));
|
---|
1043 | WinCheckButton(hwnd, CFGD_LEAVETREE, fLeaveTree);
|
---|
1044 | WinCheckButton(hwnd, CFGD_NOFOLDMENU, fNoFoldMenu);
|
---|
1045 | return 0;
|
---|
1046 |
|
---|
1047 | case WM_COMMAND:
|
---|
1048 | switch (SHORT1FROMMP(mp1)) {
|
---|
1049 | case IDM_UNDO:
|
---|
1050 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1051 | break;
|
---|
1052 |
|
---|
1053 | case DID_CANCEL:
|
---|
1054 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1055 |
|
---|
1056 | case DID_OK:
|
---|
1057 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
1058 | break;
|
---|
1059 |
|
---|
1060 | case IDM_HELP:
|
---|
1061 | if (hwndHelp)
|
---|
1062 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
1063 | MPFROM2SHORT(HELP_CFGD, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
1064 | break;
|
---|
1065 | }
|
---|
1066 | return 0;
|
---|
1067 |
|
---|
1068 | case WM_CLOSE:
|
---|
1069 | ulCnrType = 0;
|
---|
1070 | if (WinQueryButtonCheckstate(hwnd, CFGD_EXTENDEDSEL))
|
---|
1071 | ulCnrType |= CCS_EXTENDSEL;
|
---|
1072 | if (WinQueryButtonCheckstate(hwnd, CFGD_MULTIPLESEL))
|
---|
1073 | ulCnrType |= CCS_MULTIPLESEL;
|
---|
1074 | PrfWriteProfileData(fmprof, appname, "ContainerType",
|
---|
1075 | (PVOID) & ulCnrType, sizeof(BOOL));
|
---|
1076 | fMinOnOpen = WinQueryButtonCheckstate(hwnd, CFGD_MINONOPEN);
|
---|
1077 | PrfWriteProfileData(fmprof, FM3Str, "MinDirOnOpen", &fMinOnOpen,
|
---|
1078 | sizeof(BOOL));
|
---|
1079 | fLeaveTree = WinQueryButtonCheckstate(hwnd, CFGD_LEAVETREE);
|
---|
1080 | PrfWriteProfileData(fmprof, appname, "LeaveTree", &fLeaveTree,
|
---|
1081 | sizeof(BOOL));
|
---|
1082 | fNoFoldMenu = WinQueryButtonCheckstate(hwnd, CFGD_NOFOLDMENU);
|
---|
1083 | PrfWriteProfileData(fmprof, appname, "NoFoldMenu", &fNoFoldMenu,
|
---|
1084 | sizeof(BOOL));
|
---|
1085 | fSelectedAlways = WinQueryButtonCheckstate(hwnd, CFGD_SELECTEDALWAYS);
|
---|
1086 | PrfWriteProfileData(fmprof, appname, "SelectedAlways", &fSelectedAlways,
|
---|
1087 | sizeof(BOOL));
|
---|
1088 | fNoSearch = WinQueryButtonCheckstate(hwnd, CFGD_NOSEARCH);
|
---|
1089 | PrfWriteProfileData(fmprof, appname, "NoSearch", &fNoSearch,
|
---|
1090 | sizeof(BOOL));
|
---|
1091 | fLookInDir = WinQueryButtonCheckstate(hwnd, CFGD_LOOKINDIR);
|
---|
1092 | PrfWriteProfileData(fmprof, FM3Str, "LookInDir", (PVOID) & fLookInDir,
|
---|
1093 | sizeof(BOOL));
|
---|
1094 | fUnHilite = WinQueryButtonCheckstate(hwnd, CFGD_UNHILITE);
|
---|
1095 | PrfWriteProfileData(fmprof, appname, "UnHilite",
|
---|
1096 | &fUnHilite, sizeof(BOOL));
|
---|
1097 | {
|
---|
1098 | BOOL dummy = WinQueryButtonCheckstate(hwnd, CFGD_SYNCUPDATES);
|
---|
1099 |
|
---|
1100 | if (dummy != fSyncUpdates) {
|
---|
1101 | fSyncUpdates = dummy;
|
---|
1102 | if (hwndMain && !strcmp(realappname, FM3Str)) {
|
---|
1103 | if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) {
|
---|
1104 | PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2));
|
---|
1105 | PostMsg(hwndMain, UM_RESTORE, MPVOID, MPVOID);
|
---|
1106 | }
|
---|
1107 | }
|
---|
1108 | }
|
---|
1109 | }
|
---|
1110 | PrfWriteProfileData(fmprof, appname, "SyncUpdates",
|
---|
1111 | &fSyncUpdates, sizeof(BOOL));
|
---|
1112 | if (!(ulCnrType & (CCS_EXTENDSEL | CCS_MULTIPLESEL)))
|
---|
1113 | saymsg(MB_ENTER | MB_ICONEXCLAMATION,
|
---|
1114 | HWND_DESKTOP,
|
---|
1115 | GetPString(IDS_WARNINGTEXT),
|
---|
1116 | GetPString(IDS_SELECTTYPEERRORTEXT));
|
---|
1117 | break;
|
---|
1118 | }
|
---|
1119 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
1120 | }
|
---|
1121 |
|
---|
1122 | MRESULT EXPENTRY CfgMDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
1123 | {
|
---|
1124 | switch (msg) {
|
---|
1125 | case WM_INITDLG:
|
---|
1126 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1127 | break;
|
---|
1128 |
|
---|
1129 | case UM_UNDO:
|
---|
1130 | WinCheckButton(hwnd, CFGM_EXTERNALINIS, fExternalINIs);
|
---|
1131 | WinCheckButton(hwnd, CFGM_EXTERNALARCBOXES, fExternalArcboxes);
|
---|
1132 | WinCheckButton(hwnd, CFGM_EXTERNALVIEWER, fExternalViewer);
|
---|
1133 | WinCheckButton(hwnd, CFGM_EXTERNALCOLLECTOR, fExternalCollector);
|
---|
1134 | WinCheckButton(hwnd, CFGM_SAVESTATE, fSaveState);
|
---|
1135 | WinCheckButton(hwnd, CFGM_AUTOTILE, (fAutoTile));
|
---|
1136 | WinCheckButton(hwnd, CFGM_FREETREE, (fFreeTree));
|
---|
1137 | WinCheckButton(hwnd, CFGM_SPLITSTATUS, (fSplitStatus));
|
---|
1138 | WinCheckButton(hwnd, CFGM_NOTREEGAP, (fNoTreeGap));
|
---|
1139 | WinCheckButton(hwnd, CFGM_STARTMIN, (fStartMinimized));
|
---|
1140 | WinCheckButton(hwnd, CFGM_STARTMAX, (fStartMaximized));
|
---|
1141 | WinCheckButton(hwnd, CFGM_DATAMIN, (fDataMin));
|
---|
1142 | WinCheckButton(hwnd, CFGM_TILEBACKWARDS, (fTileBackwards));
|
---|
1143 | {
|
---|
1144 | long th;
|
---|
1145 |
|
---|
1146 | th = (fAutoAddDirs && fAutoAddAllDirs) ? 2 : (fAutoAddDirs) ? 1 : 0;
|
---|
1147 | WinCheckButton(hwnd, CFGM_RECENTDIRS, th);
|
---|
1148 | WinSendMsg(hwnd, UM_RESTORE, MPFROM2SHORT(CFGM_RECENTDIRS, 0), MPVOID);
|
---|
1149 | }
|
---|
1150 | WinCheckButton(hwnd, CFGM_USERLISTSWITCHES, fUserListSwitches);
|
---|
1151 | WinCheckButton(hwnd, CFGM_WSANIMATE, (fwsAnimate != 0));
|
---|
1152 | WinCheckButton(hwnd, CFGM_SEPARATEPARMS, fSeparateParms);
|
---|
1153 | WinCheckButton(hwnd, CFGM_BLUELED, fBlueLED);
|
---|
1154 | WinCheckButton(hwnd, CFGM_SHOWTARGET, fShowTarget);
|
---|
1155 | WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMAX), !(fStartMinimized));
|
---|
1156 | WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMIN), !(fStartMaximized));
|
---|
1157 | return 0;
|
---|
1158 |
|
---|
1159 | case UM_RESTORE:
|
---|
1160 | {
|
---|
1161 | long test;
|
---|
1162 | BOOL th, oh;
|
---|
1163 | char s[80];
|
---|
1164 |
|
---|
1165 | test = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1));
|
---|
1166 | th = (test != 0);
|
---|
1167 | oh = (test == 1);
|
---|
1168 | *s = 0;
|
---|
1169 | switch (SHORT1FROMMP(mp1)) {
|
---|
1170 | case CFGM_RECENTDIRS:
|
---|
1171 | sprintf(s,
|
---|
1172 | GetPString(IDS_RECENTHELPWHICHTEXT),
|
---|
1173 | (!oh && th) ?
|
---|
1174 | GetPString(IDS_RECENTONLYTEXT) :
|
---|
1175 | (oh && th) ?
|
---|
1176 | GetPString(IDS_ALLONLYTEXT) : GetPString(IDS_NONE));
|
---|
1177 | break;
|
---|
1178 | }
|
---|
1179 | if (*s)
|
---|
1180 | WinSetDlgItemText(hwnd, SHORT1FROMMP(mp1), s);
|
---|
1181 | }
|
---|
1182 | return 0;
|
---|
1183 |
|
---|
1184 | case WM_CONTROL:
|
---|
1185 | switch (SHORT1FROMMP(mp1)) {
|
---|
1186 | case CFGM_RECENTDIRS:
|
---|
1187 | WinSendMsg(hwnd, UM_RESTORE, mp1, MPVOID);
|
---|
1188 | break;
|
---|
1189 | case CFGM_STARTMIN:
|
---|
1190 | if (WinQueryButtonCheckstate(hwnd, CFGM_STARTMIN)) {
|
---|
1191 | WinCheckButton(hwnd, CFGM_STARTMAX, FALSE);
|
---|
1192 | WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMAX), FALSE);
|
---|
1193 | }
|
---|
1194 | else
|
---|
1195 | WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMAX), TRUE);
|
---|
1196 | break;
|
---|
1197 | case CFGM_STARTMAX:
|
---|
1198 | if (WinQueryButtonCheckstate(hwnd, CFGM_STARTMAX)) {
|
---|
1199 | WinCheckButton(hwnd, CFGM_STARTMIN, FALSE);
|
---|
1200 | WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMIN), FALSE);
|
---|
1201 | }
|
---|
1202 | else
|
---|
1203 | WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMIN), TRUE);
|
---|
1204 | break;
|
---|
1205 | }
|
---|
1206 | return 0;
|
---|
1207 |
|
---|
1208 | case WM_COMMAND:
|
---|
1209 | switch (SHORT1FROMMP(mp1)) {
|
---|
1210 | case IDM_UNDO:
|
---|
1211 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1212 | break;
|
---|
1213 |
|
---|
1214 | case DID_CANCEL:
|
---|
1215 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1216 |
|
---|
1217 | case DID_OK:
|
---|
1218 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
1219 | break;
|
---|
1220 |
|
---|
1221 | case IDM_HELP:
|
---|
1222 | if (hwndHelp)
|
---|
1223 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
1224 | MPFROM2SHORT(HELP_CFGM, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
1225 | break;
|
---|
1226 | }
|
---|
1227 | return 0;
|
---|
1228 |
|
---|
1229 | case WM_CLOSE:
|
---|
1230 | if (hwndMain && !strcmp(realappname, FM3Str)) {
|
---|
1231 | if (fFreeTree != WinQueryButtonCheckstate(hwnd, CFGM_FREETREE))
|
---|
1232 | PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_FREETREE, 0), MPVOID);
|
---|
1233 | if (fAutoTile != WinQueryButtonCheckstate(hwnd, CFGM_AUTOTILE))
|
---|
1234 | PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_AUTOTILE, 0), MPVOID);
|
---|
1235 | if (fSplitStatus != WinQueryButtonCheckstate(hwnd, CFGM_SPLITSTATUS)) {
|
---|
1236 | fSplitStatus = (fSplitStatus) ? FALSE : TRUE;
|
---|
1237 | PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_BLINK, 0), MPVOID);
|
---|
1238 | PrfWriteProfileData(fmprof, FM3Str, "SplitStatus", &fSplitStatus,
|
---|
1239 | sizeof(BOOL));
|
---|
1240 | }
|
---|
1241 | }
|
---|
1242 | fUserListSwitches = WinQueryButtonCheckstate(hwnd, CFGM_USERLISTSWITCHES);
|
---|
1243 | PrfWriteProfileData(fmprof, FM3Str, "UserListSwitches",
|
---|
1244 | (PVOID) & fUserListSwitches, sizeof(BOOL));
|
---|
1245 | fExternalINIs = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALINIS);
|
---|
1246 | PrfWriteProfileData(fmprof, FM3Str, "ExternalINIs",
|
---|
1247 | (PVOID) & fExternalINIs, sizeof(BOOL));
|
---|
1248 | fExternalArcboxes = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALARCBOXES);
|
---|
1249 | PrfWriteProfileData(fmprof, FM3Str, "ExternalArcboxes",
|
---|
1250 | (PVOID) & fExternalArcboxes, sizeof(BOOL));
|
---|
1251 | fExternalCollector =
|
---|
1252 | WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALCOLLECTOR);
|
---|
1253 | PrfWriteProfileData(fmprof, FM3Str, "ExternalCollector",
|
---|
1254 | (PVOID) & fExternalCollector, sizeof(BOOL));
|
---|
1255 | fExternalViewer = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALVIEWER);
|
---|
1256 | PrfWriteProfileData(fmprof, FM3Str, "ExternalViewer",
|
---|
1257 | (PVOID) & fExternalViewer, sizeof(BOOL));
|
---|
1258 | {
|
---|
1259 | long test;
|
---|
1260 |
|
---|
1261 | test = WinQueryButtonCheckstate(hwnd, CFGM_RECENTDIRS);
|
---|
1262 | fAutoAddDirs = (test != 0);
|
---|
1263 | fAutoAddAllDirs = (test == 2);
|
---|
1264 | }
|
---|
1265 | PrfWriteProfileData(fmprof,
|
---|
1266 | appname,
|
---|
1267 | "AutoAddDirs", (PVOID) & fAutoAddDirs, sizeof(BOOL));
|
---|
1268 | PrfWriteProfileData(fmprof,
|
---|
1269 | appname,
|
---|
1270 | "AutoAddAllDirs",
|
---|
1271 | (PVOID) & fAutoAddAllDirs, sizeof(BOOL));
|
---|
1272 | fwsAnimate = WinQueryButtonCheckstate(hwnd, CFGM_WSANIMATE);
|
---|
1273 | if (fwsAnimate)
|
---|
1274 | fwsAnimate = WS_ANIMATE;
|
---|
1275 | PrfWriteProfileData(fmprof,
|
---|
1276 | appname,
|
---|
1277 | "WS_ANIMATE", (PVOID) & fwsAnimate, sizeof(ULONG));
|
---|
1278 | fSaveState = WinQueryButtonCheckstate(hwnd, CFGM_SAVESTATE);
|
---|
1279 | PrfWriteProfileData(fmprof,
|
---|
1280 | FM3Str,
|
---|
1281 | "SaveState", (PVOID) & fSaveState, sizeof(BOOL));
|
---|
1282 | fStartMinimized = WinQueryButtonCheckstate(hwnd, CFGM_STARTMIN);
|
---|
1283 | PrfWriteProfileData(fmprof,
|
---|
1284 | appname,
|
---|
1285 | "StartMinimized",
|
---|
1286 | (PVOID) & fStartMinimized, sizeof(BOOL));
|
---|
1287 | fStartMaximized = WinQueryButtonCheckstate(hwnd, CFGM_STARTMAX);
|
---|
1288 | PrfWriteProfileData(fmprof,
|
---|
1289 | appname,
|
---|
1290 | "StartMaximized",
|
---|
1291 | (PVOID) & fStartMaximized, sizeof(BOOL));
|
---|
1292 | fDataMin = WinQueryButtonCheckstate(hwnd, CFGM_DATAMIN);
|
---|
1293 | PrfWriteProfileData(fmprof,
|
---|
1294 | FM3Str, "DataMin", (PVOID) & fDataMin, sizeof(BOOL));
|
---|
1295 | fTileBackwards = WinQueryButtonCheckstate(hwnd, CFGM_TILEBACKWARDS);
|
---|
1296 | PrfWriteProfileData(fmprof,
|
---|
1297 | FM3Str,
|
---|
1298 | "TileBackwards",
|
---|
1299 | (PVOID) & fTileBackwards, sizeof(BOOL));
|
---|
1300 | fNoTreeGap = WinQueryButtonCheckstate(hwnd, CFGM_NOTREEGAP);
|
---|
1301 | PrfWriteProfileData(fmprof,
|
---|
1302 | FM3Str,
|
---|
1303 | "NoTreeGap", (PVOID) & fNoTreeGap, sizeof(BOOL));
|
---|
1304 | fBlueLED = WinQueryButtonCheckstate(hwnd, CFGM_BLUELED);
|
---|
1305 | PrfWriteProfileData(fmprof,
|
---|
1306 | appname, "BlueLED", (PVOID) & fBlueLED, sizeof(BOOL));
|
---|
1307 | {
|
---|
1308 | BOOL dummy;
|
---|
1309 |
|
---|
1310 | dummy = WinQueryButtonCheckstate(hwnd, CFGM_SHOWTARGET);
|
---|
1311 | if (dummy != fShowTarget) {
|
---|
1312 | fShowTarget = dummy;
|
---|
1313 | PrfWriteProfileData(fmprof,
|
---|
1314 | appname,
|
---|
1315 | "ShowTarget",
|
---|
1316 | (PVOID) & fShowTarget, sizeof(BOOL));
|
---|
1317 | if (hwndMain)
|
---|
1318 | PostMsg(WinQueryWindow(hwndMain, QW_PARENT),
|
---|
1319 | WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);
|
---|
1320 | SetTargetDir(hwnd, TRUE);
|
---|
1321 | }
|
---|
1322 | dummy = WinQueryButtonCheckstate(hwnd, CFGM_SEPARATEPARMS);
|
---|
1323 | if (dummy != fSeparateParms) {
|
---|
1324 | fSeparateParms = dummy;
|
---|
1325 | PrfWriteProfileData(fmprof,
|
---|
1326 | FM3Str,
|
---|
1327 | "SeparateParms",
|
---|
1328 | (PVOID) & fSeparateParms, sizeof(BOOL));
|
---|
1329 | WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER),
|
---|
1330 | UM_UNDO, MPVOID, MPVOID);
|
---|
1331 | }
|
---|
1332 | }
|
---|
1333 | break;
|
---|
1334 | }
|
---|
1335 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
1336 | }
|
---|
1337 |
|
---|
1338 | MRESULT EXPENTRY Cfg5DlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
1339 | {
|
---|
1340 | static MASK mask;
|
---|
1341 |
|
---|
1342 | switch (msg) {
|
---|
1343 | case WM_INITDLG:
|
---|
1344 | WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETTEXTLIMIT,
|
---|
1345 | MPFROMSHORT(8), MPVOID);
|
---|
1346 | WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_OVERRIDESETLIMITS,
|
---|
1347 | MPFROMLONG(1000), MPFROMLONG(50));
|
---|
1348 | WinSendDlgItemMsg(hwnd,
|
---|
1349 | CFG5_FILTER,
|
---|
1350 | EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
1351 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1352 | break;
|
---|
1353 |
|
---|
1354 | case UM_FOCUSME:
|
---|
1355 | WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, CFG5_MINIICONS));
|
---|
1356 | return 0;
|
---|
1357 |
|
---|
1358 | case UM_UNDO:
|
---|
1359 | {
|
---|
1360 | ULONG flWindowAttr = 0, size = sizeof(ULONG);
|
---|
1361 |
|
---|
1362 | if (!PrfQueryProfileData(fmprof,
|
---|
1363 | appname,
|
---|
1364 | "DirflWindowAttr", &flWindowAttr, &size))
|
---|
1365 | flWindowAttr = (CV_NAME | CV_MINI | CA_DETAILSVIEWTITLES | CV_FLOW);
|
---|
1366 | if (flWindowAttr & CV_ICON)
|
---|
1367 | WinCheckButton(hwnd, CFG5_ICON, TRUE);
|
---|
1368 | if (flWindowAttr & CV_NAME)
|
---|
1369 | WinCheckButton(hwnd, CFG5_NAME, TRUE);
|
---|
1370 | if (flWindowAttr & CV_TEXT)
|
---|
1371 | WinCheckButton(hwnd, CFG5_TEXT, TRUE);
|
---|
1372 | if (flWindowAttr & CV_DETAIL)
|
---|
1373 | WinCheckButton(hwnd, CFG5_DETAIL, TRUE);
|
---|
1374 | if (flWindowAttr & CV_MINI)
|
---|
1375 | WinCheckButton(hwnd, CFG5_MINIICONS, TRUE);
|
---|
1376 | if (flWindowAttr & CA_DETAILSVIEWTITLES)
|
---|
1377 | WinCheckButton(hwnd, CFG5_SHOWTITLES, TRUE);
|
---|
1378 | WinCheckButton(hwnd, CFG5_SHOWLNAMES, detailslongname);
|
---|
1379 | WinCheckButton(hwnd, CFG5_SHOWSUBJECT, detailssubject);
|
---|
1380 | WinCheckButton(hwnd, CFG5_SHOWEAS, detailsea);
|
---|
1381 | WinCheckButton(hwnd, CFG5_SHOWSIZE, detailssize);
|
---|
1382 | WinCheckButton(hwnd, CFG5_SHOWICON, detailsicon);
|
---|
1383 | WinCheckButton(hwnd, CFG5_SHOWLWDATE, detailslwdate);
|
---|
1384 | WinCheckButton(hwnd, CFG5_SHOWLWTIME, detailslwtime);
|
---|
1385 | WinCheckButton(hwnd, CFG5_SHOWLADATE, detailsladate);
|
---|
1386 | WinCheckButton(hwnd, CFG5_SHOWLATIME, detailslatime);
|
---|
1387 | WinCheckButton(hwnd, CFG5_SHOWCRDATE, detailscrdate);
|
---|
1388 | WinCheckButton(hwnd, CFG5_SHOWCRTIME, detailscrtime);
|
---|
1389 | WinCheckButton(hwnd, CFG5_SHOWATTR, detailsattr);
|
---|
1390 | memset(&mask, 0, sizeof(mask));
|
---|
1391 | mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN |
|
---|
1392 | FILE_SYSTEM | FILE_NORMAL | FILE_READONLY;
|
---|
1393 | size = sizeof(MASK);
|
---|
1394 | if (PrfQueryProfileData(fmprof, appname, "DirFilter", &mask, &size))
|
---|
1395 | SetMask(NULL, &mask);
|
---|
1396 | if (!mask.attrFile)
|
---|
1397 | mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN |
|
---|
1398 | FILE_SYSTEM | FILE_NORMAL | FILE_READONLY;
|
---|
1399 | strcpy(mask.prompt, GetPString(IDS_DEFDIRFILTERTITLETEXT));
|
---|
1400 | WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask);
|
---|
1401 | WinCheckButton(hwnd, CFG5_SUBJECTINLEFTPANE, fSubjectInLeftPane);
|
---|
1402 | WinCheckButton(hwnd, CFG5_SUBJECTLENGTHMAX, fSubjectLengthMax);
|
---|
1403 | WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETCURRENTVALUE,
|
---|
1404 | MPFROMLONG(SubjectDisplayWidth), MPVOID);
|
---|
1405 | }
|
---|
1406 | return 0;
|
---|
1407 |
|
---|
1408 | case UM_SETUP5:
|
---|
1409 | if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc,
|
---|
1410 | FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) {
|
---|
1411 | SetMask(NULL, &mask);
|
---|
1412 | WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask);
|
---|
1413 | }
|
---|
1414 | return 0;
|
---|
1415 |
|
---|
1416 | case WM_CONTROL:
|
---|
1417 | switch (SHORT1FROMMP(mp1)) {
|
---|
1418 | case CFG5_FILTER:
|
---|
1419 | switch (SHORT2FROMMP(mp1)) {
|
---|
1420 | case EN_SETFOCUS:
|
---|
1421 | PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);
|
---|
1422 | PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID);
|
---|
1423 | break;
|
---|
1424 | }
|
---|
1425 | break;
|
---|
1426 | }
|
---|
1427 | return 0;
|
---|
1428 |
|
---|
1429 | case WM_COMMAND:
|
---|
1430 | switch (SHORT1FROMMP(mp1)) {
|
---|
1431 | case IDM_UNDO:
|
---|
1432 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1433 | break;
|
---|
1434 |
|
---|
1435 | case DID_CANCEL:
|
---|
1436 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1437 |
|
---|
1438 | case DID_OK:
|
---|
1439 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
1440 | break;
|
---|
1441 |
|
---|
1442 | case IDM_HELP:
|
---|
1443 | if (hwndHelp)
|
---|
1444 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
1445 | MPFROM2SHORT(HELP_CFG5, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
1446 | break;
|
---|
1447 | }
|
---|
1448 | return 0;
|
---|
1449 |
|
---|
1450 | case WM_CLOSE:
|
---|
1451 | {
|
---|
1452 | ULONG flWindowAttr = 0;
|
---|
1453 |
|
---|
1454 | if (WinQueryButtonCheckstate(hwnd, CFG5_ICON))
|
---|
1455 | flWindowAttr |= CV_ICON;
|
---|
1456 | if (WinQueryButtonCheckstate(hwnd, CFG5_NAME))
|
---|
1457 | flWindowAttr |= CV_NAME;
|
---|
1458 | if (WinQueryButtonCheckstate(hwnd, CFG5_TEXT))
|
---|
1459 | flWindowAttr |= CV_TEXT;
|
---|
1460 | if (WinQueryButtonCheckstate(hwnd, CFG5_DETAIL))
|
---|
1461 | flWindowAttr |= CV_DETAIL;
|
---|
1462 | if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS))
|
---|
1463 | flWindowAttr |= CV_MINI;
|
---|
1464 | if (WinQueryButtonCheckstate(hwnd, CFG5_SHOWTITLES))
|
---|
1465 | flWindowAttr |= CA_DETAILSVIEWTITLES;
|
---|
1466 | flWindowAttr |= CV_FLOW;
|
---|
1467 | PrfWriteProfileData(fmprof,
|
---|
1468 | appname,
|
---|
1469 | "DirflWindowAttr", &flWindowAttr, sizeof(ULONG));
|
---|
1470 | }
|
---|
1471 | detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES);
|
---|
1472 | PrfWriteProfileData(fmprof, appname, "DetailsLongname",
|
---|
1473 | &detailslongname, sizeof(BOOL));
|
---|
1474 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname",
|
---|
1475 | // &detailslongname, sizeof(BOOL));
|
---|
1476 | detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT);
|
---|
1477 | PrfWriteProfileData(fmprof, appname, "DetailsSubject",
|
---|
1478 | &detailssubject, sizeof(BOOL));
|
---|
1479 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject",
|
---|
1480 | // &detailssubject, sizeof(BOOL));
|
---|
1481 | detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWEAS);
|
---|
1482 | PrfWriteProfileData(fmprof, appname, "DetailsEA",
|
---|
1483 | &detailsea, sizeof(BOOL));
|
---|
1484 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA",
|
---|
1485 | // &detailsea, sizeof(BOOL));
|
---|
1486 | detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE);
|
---|
1487 | PrfWriteProfileData(fmprof, appname, "DetailsSize",
|
---|
1488 | &detailssize, sizeof(BOOL));
|
---|
1489 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize",
|
---|
1490 | // &detailssize, sizeof(BOOL));
|
---|
1491 | detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON);
|
---|
1492 | PrfWriteProfileData(fmprof, appname, "DetailsIcon",
|
---|
1493 | &detailsicon, sizeof(BOOL));
|
---|
1494 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon",
|
---|
1495 | // &detailsicon, sizeof(BOOL));
|
---|
1496 | detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE);
|
---|
1497 | PrfWriteProfileData(fmprof, appname, "DetailsLWDate",
|
---|
1498 | &detailslwdate, sizeof(BOOL));
|
---|
1499 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate",
|
---|
1500 | // &detailslwdate, sizeof(BOOL));
|
---|
1501 | detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME);
|
---|
1502 | PrfWriteProfileData(fmprof, appname, "DetailsLWTime",
|
---|
1503 | &detailslwtime, sizeof(BOOL));
|
---|
1504 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime",
|
---|
1505 | // &detailslwtime, sizeof(BOOL));
|
---|
1506 | detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE);
|
---|
1507 | PrfWriteProfileData(fmprof, appname, "DetailsLADate",
|
---|
1508 | &detailsladate, sizeof(BOOL));
|
---|
1509 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate",
|
---|
1510 | // &detailsladate, sizeof(BOOL));
|
---|
1511 | detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME);
|
---|
1512 | PrfWriteProfileData(fmprof, appname, "DetailsLATime",
|
---|
1513 | &detailslatime, sizeof(BOOL));
|
---|
1514 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime",
|
---|
1515 | // &detailslatime, sizeof(BOOL));
|
---|
1516 | detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE);
|
---|
1517 | PrfWriteProfileData(fmprof, appname, "DetailsCRDate",
|
---|
1518 | &detailscrdate, sizeof(BOOL));
|
---|
1519 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate",
|
---|
1520 | // &detailscrdate, sizeof(BOOL));
|
---|
1521 | detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME);
|
---|
1522 | PrfWriteProfileData(fmprof, appname, "DetailsCRTime",
|
---|
1523 | &detailscrtime, sizeof(BOOL));
|
---|
1524 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime",
|
---|
1525 | // &detailscrtime, sizeof(BOOL));
|
---|
1526 | detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR);
|
---|
1527 | PrfWriteProfileData(fmprof, appname, "DetailsAttr",
|
---|
1528 | &detailsattr, sizeof(BOOL));
|
---|
1529 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr",
|
---|
1530 | // &detailsattr, sizeof(BOOL));
|
---|
1531 | fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE);
|
---|
1532 | PrfWriteProfileData(fmprof, appname, "SubjectInLeftPane",
|
---|
1533 | &fSubjectInLeftPane, sizeof(BOOL));
|
---|
1534 | PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectInLeftPane",
|
---|
1535 | &fSubjectInLeftPane, sizeof(BOOL));
|
---|
1536 | fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX);
|
---|
1537 | PrfWriteProfileData(fmprof, appname, "SubjectLengthMax",
|
---|
1538 | &fSubjectInLeftPane, sizeof(BOOL));
|
---|
1539 | PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectLengthMax",
|
---|
1540 | &fSubjectInLeftPane, sizeof(BOOL));
|
---|
1541 | *mask.prompt = 0;
|
---|
1542 | PrfWriteProfileData(fmprof, appname, "DirFilter", &mask, sizeof(MASK));
|
---|
1543 | {
|
---|
1544 | if (!WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX)) {
|
---|
1545 | WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_QUERYVALUE,
|
---|
1546 | MPFROMP(&SubjectDisplayWidth), MPFROM2SHORT(0, SPBQ_DONOTUPDATE));
|
---|
1547 | if (SubjectDisplayWidth < 50)
|
---|
1548 | SubjectDisplayWidth = 0;
|
---|
1549 | else if (SubjectDisplayWidth > 1000)
|
---|
1550 | SubjectDisplayWidth = 1000;
|
---|
1551 | }
|
---|
1552 | else
|
---|
1553 | SubjectDisplayWidth = 0;
|
---|
1554 | PrfWriteProfileData(fmprof,
|
---|
1555 | appname, "SubjectDisplayWidth",
|
---|
1556 | &SubjectDisplayWidth, sizeof(ULONG));
|
---|
1557 | PrfWriteProfileData(fmprof,
|
---|
1558 | appname, "DirCnr.SubjectDisplayWidth",
|
---|
1559 | &SubjectDisplayWidth, sizeof(ULONG));
|
---|
1560 | }
|
---|
1561 | break;
|
---|
1562 | }
|
---|
1563 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
1564 | }
|
---|
1565 |
|
---|
1566 | MRESULT EXPENTRY Cfg6DlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
1567 | {
|
---|
1568 | switch (msg) {
|
---|
1569 | case WM_INITDLG:
|
---|
1570 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1571 | break;
|
---|
1572 |
|
---|
1573 | case UM_UNDO:
|
---|
1574 | WinCheckButton(hwnd, CFG6_SORTFIRST, FALSE);
|
---|
1575 | WinCheckButton(hwnd, CFG6_SORTLAST, FALSE);
|
---|
1576 | WinCheckButton(hwnd, CFG6_SORTSIZE, FALSE);
|
---|
1577 | WinCheckButton(hwnd, CFG6_SORTEASIZE, FALSE);
|
---|
1578 | WinCheckButton(hwnd, CFG6_SORTLWDATE, FALSE);
|
---|
1579 | WinCheckButton(hwnd, CFG6_SORTLADATE, FALSE);
|
---|
1580 | WinCheckButton(hwnd, CFG6_SORTCRDATE, FALSE);
|
---|
1581 | WinCheckButton(hwnd, CFG6_SORTNAME, FALSE);
|
---|
1582 | WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE);
|
---|
1583 | WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE);
|
---|
1584 | WinCheckButton(hwnd, CFG6_SORTREVERSE, FALSE);
|
---|
1585 | if (sortFlags & SORT_FIRSTEXTENSION)
|
---|
1586 | WinCheckButton(hwnd, CFG6_SORTFIRST, TRUE);
|
---|
1587 | else if (sortFlags & SORT_LASTEXTENSION)
|
---|
1588 | WinCheckButton(hwnd, CFG6_SORTLAST, TRUE);
|
---|
1589 | else if (sortFlags & SORT_SIZE)
|
---|
1590 | WinCheckButton(hwnd, CFG6_SORTSIZE, TRUE);
|
---|
1591 | else if (sortFlags & SORT_EASIZE)
|
---|
1592 | WinCheckButton(hwnd, CFG6_SORTEASIZE, TRUE);
|
---|
1593 | else if (sortFlags & SORT_LWDATE)
|
---|
1594 | WinCheckButton(hwnd, CFG6_SORTLWDATE, TRUE);
|
---|
1595 | else if (sortFlags & SORT_LADATE)
|
---|
1596 | WinCheckButton(hwnd, CFG6_SORTLADATE, TRUE);
|
---|
1597 | else if (sortFlags & SORT_CRDATE)
|
---|
1598 | WinCheckButton(hwnd, CFG6_SORTCRDATE, TRUE);
|
---|
1599 | else if (sortFlags & SORT_FILENAME)
|
---|
1600 | WinCheckButton(hwnd, CFG6_SORTFILENAME, TRUE);
|
---|
1601 | else
|
---|
1602 | WinCheckButton(hwnd, CFG6_SORTNAME, TRUE);
|
---|
1603 | if (sortFlags & SORT_DIRSFIRST)
|
---|
1604 | WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, TRUE);
|
---|
1605 | else if (sortFlags & SORT_DIRSLAST)
|
---|
1606 | WinCheckButton(hwnd, CFG6_SORTDIRSLAST, TRUE);
|
---|
1607 | if (sortFlags & SORT_REVERSE)
|
---|
1608 | WinCheckButton(hwnd, CFG6_SORTREVERSE, TRUE);
|
---|
1609 | return 0;
|
---|
1610 |
|
---|
1611 | case WM_CONTROL:
|
---|
1612 | switch (SHORT1FROMMP(mp1)) {
|
---|
1613 | case CFG6_SORTDIRSFIRST:
|
---|
1614 | case CFG6_SORTDIRSLAST:
|
---|
1615 | {
|
---|
1616 | BOOL temp;
|
---|
1617 |
|
---|
1618 | temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1));
|
---|
1619 | if (temp) {
|
---|
1620 | switch (SHORT1FROMMP(mp1)) {
|
---|
1621 | case CFG6_SORTDIRSFIRST:
|
---|
1622 | WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE);
|
---|
1623 | break;
|
---|
1624 | case CFG6_SORTDIRSLAST:
|
---|
1625 | WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE);
|
---|
1626 | break;
|
---|
1627 | }
|
---|
1628 | }
|
---|
1629 | }
|
---|
1630 | break;
|
---|
1631 | }
|
---|
1632 | return 0;
|
---|
1633 |
|
---|
1634 | case WM_COMMAND:
|
---|
1635 | switch (SHORT1FROMMP(mp1)) {
|
---|
1636 | case IDM_UNDO:
|
---|
1637 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1638 | break;
|
---|
1639 |
|
---|
1640 | case DID_CANCEL:
|
---|
1641 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1642 |
|
---|
1643 | case DID_OK:
|
---|
1644 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
1645 | break;
|
---|
1646 |
|
---|
1647 | case IDM_HELP:
|
---|
1648 | if (hwndHelp)
|
---|
1649 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
1650 | MPFROM2SHORT(HELP_CFG6, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
1651 | break;
|
---|
1652 | }
|
---|
1653 | return 0;
|
---|
1654 |
|
---|
1655 | case WM_CLOSE:
|
---|
1656 | sortFlags = 0;
|
---|
1657 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTFILENAME))
|
---|
1658 | sortFlags |= SORT_FILENAME;
|
---|
1659 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTSIZE))
|
---|
1660 | sortFlags |= SORT_SIZE;
|
---|
1661 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTEASIZE))
|
---|
1662 | sortFlags |= SORT_EASIZE;
|
---|
1663 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTFIRST))
|
---|
1664 | sortFlags |= SORT_FIRSTEXTENSION;
|
---|
1665 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLAST))
|
---|
1666 | sortFlags |= SORT_LASTEXTENSION;
|
---|
1667 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLWDATE))
|
---|
1668 | sortFlags |= SORT_LWDATE;
|
---|
1669 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLADATE))
|
---|
1670 | sortFlags |= SORT_LADATE;
|
---|
1671 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTCRDATE))
|
---|
1672 | sortFlags |= SORT_CRDATE;
|
---|
1673 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTDIRSFIRST))
|
---|
1674 | sortFlags |= SORT_DIRSFIRST;
|
---|
1675 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTDIRSLAST))
|
---|
1676 | sortFlags |= SORT_DIRSLAST;
|
---|
1677 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTREVERSE))
|
---|
1678 | sortFlags |= SORT_REVERSE;
|
---|
1679 | PrfWriteProfileData(fmprof, appname, "Sort", &sortFlags, sizeof(INT));
|
---|
1680 | break;
|
---|
1681 | }
|
---|
1682 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
1683 | }
|
---|
1684 |
|
---|
1685 | MRESULT EXPENTRY Cfg7DlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
1686 | {
|
---|
1687 | static MASK mask;
|
---|
1688 |
|
---|
1689 | switch (msg) {
|
---|
1690 | case WM_INITDLG:
|
---|
1691 | WinSendDlgItemMsg(hwnd, CFG5_FILTER, EM_SETTEXTLIMIT,
|
---|
1692 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
1693 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1694 | break;
|
---|
1695 |
|
---|
1696 | case UM_FOCUSME:
|
---|
1697 | WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, CFG5_MINIICONS));
|
---|
1698 | return 0;
|
---|
1699 |
|
---|
1700 | case UM_UNDO:
|
---|
1701 | WinCheckButton(hwnd, CFG5_EXTERNALCOLLECTOR, fExternalCollector);
|
---|
1702 | {
|
---|
1703 | ULONG flWindowAttr = 0, size = sizeof(ULONG);
|
---|
1704 |
|
---|
1705 | if (!PrfQueryProfileData(fmprof,
|
---|
1706 | appname,
|
---|
1707 | "CollectorflWindowAttr", &flWindowAttr, &size))
|
---|
1708 | flWindowAttr = (CV_NAME | CA_DETAILSVIEWTITLES | CV_MINI | CV_FLOW);
|
---|
1709 | if (flWindowAttr & CV_ICON)
|
---|
1710 | WinCheckButton(hwnd, CFG5_ICON, TRUE);
|
---|
1711 | if (flWindowAttr & CV_NAME)
|
---|
1712 | WinCheckButton(hwnd, CFG5_NAME, TRUE);
|
---|
1713 | if (flWindowAttr & CV_TEXT)
|
---|
1714 | WinCheckButton(hwnd, CFG5_TEXT, TRUE);
|
---|
1715 | if (flWindowAttr & CV_DETAIL)
|
---|
1716 | WinCheckButton(hwnd, CFG5_DETAIL, TRUE);
|
---|
1717 | if (flWindowAttr & CV_MINI)
|
---|
1718 | WinCheckButton(hwnd, CFG5_MINIICONS, TRUE);
|
---|
1719 | if (flWindowAttr & CA_DETAILSVIEWTITLES)
|
---|
1720 | WinCheckButton(hwnd, CFG5_SHOWTITLES, TRUE);
|
---|
1721 | memset(&mask, 0, sizeof(mask));
|
---|
1722 | mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN |
|
---|
1723 | FILE_SYSTEM | FILE_NORMAL | FILE_READONLY;
|
---|
1724 | size = sizeof(MASK);
|
---|
1725 | if (PrfQueryProfileData(fmprof,
|
---|
1726 | appname, "CollectorFilter", &mask, &size)) {
|
---|
1727 | SetMask(NULL, &mask);
|
---|
1728 | }
|
---|
1729 | if (!mask.attrFile)
|
---|
1730 | mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN |
|
---|
1731 | FILE_SYSTEM | FILE_NORMAL | FILE_READONLY;
|
---|
1732 | strcpy(mask.prompt, GetPString(IDS_DEFCOLFILTERTITLETEXT));
|
---|
1733 | WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask);
|
---|
1734 | }
|
---|
1735 | {
|
---|
1736 | DIRCNRDATA dcd;
|
---|
1737 |
|
---|
1738 | memset(&dcd, 0, sizeof(dcd));
|
---|
1739 | LoadDetailsSwitches("Collector", &dcd);
|
---|
1740 | WinCheckButton(hwnd, CFG5_SHOWLNAMES, dcd.detailslongname);
|
---|
1741 | WinCheckButton(hwnd, CFG5_SHOWSUBJECT, dcd.detailssubject);
|
---|
1742 | WinCheckButton(hwnd, CFG5_SHOWEAS, dcd.detailsea);
|
---|
1743 | WinCheckButton(hwnd, CFG5_SHOWSIZE, dcd.detailssize);
|
---|
1744 | WinCheckButton(hwnd, CFG5_SHOWICON, dcd.detailsicon);
|
---|
1745 | WinCheckButton(hwnd, CFG5_SHOWLWDATE, dcd.detailslwdate);
|
---|
1746 | WinCheckButton(hwnd, CFG5_SHOWLWTIME, dcd.detailslwtime);
|
---|
1747 | WinCheckButton(hwnd, CFG5_SHOWLADATE, dcd.detailsladate);
|
---|
1748 | WinCheckButton(hwnd, CFG5_SHOWLATIME, dcd.detailslatime);
|
---|
1749 | WinCheckButton(hwnd, CFG5_SHOWCRDATE, dcd.detailscrdate);
|
---|
1750 | WinCheckButton(hwnd, CFG5_SHOWCRTIME, dcd.detailscrtime);
|
---|
1751 | WinCheckButton(hwnd, CFG5_SHOWATTR, dcd.detailsattr);
|
---|
1752 | }
|
---|
1753 | return 0;
|
---|
1754 |
|
---|
1755 | case UM_SETUP5:
|
---|
1756 | if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc,
|
---|
1757 | FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) {
|
---|
1758 | SetMask(NULL, &mask);
|
---|
1759 | WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask);
|
---|
1760 | }
|
---|
1761 | return 0;
|
---|
1762 |
|
---|
1763 | case WM_CONTROL:
|
---|
1764 | switch (SHORT1FROMMP(mp1)) {
|
---|
1765 | case CFG5_FILTER:
|
---|
1766 | switch (SHORT2FROMMP(mp1)) {
|
---|
1767 | case EN_SETFOCUS:
|
---|
1768 | PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);
|
---|
1769 | PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID);
|
---|
1770 | break;
|
---|
1771 | }
|
---|
1772 | break;
|
---|
1773 | }
|
---|
1774 | return 0;
|
---|
1775 |
|
---|
1776 | case WM_COMMAND:
|
---|
1777 | switch (SHORT1FROMMP(mp1)) {
|
---|
1778 | case IDM_UNDO:
|
---|
1779 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1780 | break;
|
---|
1781 |
|
---|
1782 | case DID_CANCEL:
|
---|
1783 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1784 |
|
---|
1785 | case DID_OK:
|
---|
1786 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
1787 | break;
|
---|
1788 |
|
---|
1789 | case IDM_HELP:
|
---|
1790 | if (hwndHelp)
|
---|
1791 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
1792 | MPFROM2SHORT(HELP_CFG7, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
1793 | break;
|
---|
1794 | }
|
---|
1795 | return 0;
|
---|
1796 |
|
---|
1797 | case WM_CLOSE:
|
---|
1798 | fExternalCollector = WinQueryButtonCheckstate(hwnd,
|
---|
1799 | CFG5_EXTERNALCOLLECTOR);
|
---|
1800 | PrfWriteProfileData(fmprof, FM3Str, "ExternalCollector",
|
---|
1801 | &fExternalCollector, sizeof(BOOL));
|
---|
1802 | {
|
---|
1803 | ULONG flWindowAttr = 0;
|
---|
1804 |
|
---|
1805 | if (WinQueryButtonCheckstate(hwnd, CFG5_ICON))
|
---|
1806 | flWindowAttr |= CV_ICON;
|
---|
1807 | if (WinQueryButtonCheckstate(hwnd, CFG5_NAME))
|
---|
1808 | flWindowAttr |= CV_NAME;
|
---|
1809 | if (WinQueryButtonCheckstate(hwnd, CFG5_TEXT))
|
---|
1810 | flWindowAttr |= CV_TEXT;
|
---|
1811 | if (WinQueryButtonCheckstate(hwnd, CFG5_DETAIL))
|
---|
1812 | flWindowAttr |= CV_DETAIL;
|
---|
1813 | if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS))
|
---|
1814 | flWindowAttr |= CV_MINI;
|
---|
1815 | if (WinQueryButtonCheckstate(hwnd, CFG5_SHOWTITLES))
|
---|
1816 | flWindowAttr |= CA_DETAILSVIEWTITLES;
|
---|
1817 | flWindowAttr |= CV_FLOW;
|
---|
1818 | PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr",
|
---|
1819 | &flWindowAttr, sizeof(ULONG));
|
---|
1820 | }
|
---|
1821 | {
|
---|
1822 | DIRCNRDATA dcd;
|
---|
1823 |
|
---|
1824 | memset(&dcd, 0, sizeof(dcd));
|
---|
1825 | dcd.detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES);
|
---|
1826 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsLongname",
|
---|
1827 | &dcd.detailslongname, sizeof(BOOL));
|
---|
1828 | dcd.detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT);
|
---|
1829 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsSubject",
|
---|
1830 | &dcd.detailssubject, sizeof(BOOL));
|
---|
1831 | dcd.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWEAS);
|
---|
1832 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsEA",
|
---|
1833 | &dcd.detailsea, sizeof(BOOL));
|
---|
1834 | dcd.detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE);
|
---|
1835 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsSize",
|
---|
1836 | &dcd.detailssize, sizeof(BOOL));
|
---|
1837 | dcd.detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON);
|
---|
1838 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsIcon",
|
---|
1839 | &dcd.detailsicon, sizeof(BOOL));
|
---|
1840 | dcd.detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE);
|
---|
1841 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWDate",
|
---|
1842 | &dcd.detailslwdate, sizeof(BOOL));
|
---|
1843 | dcd.detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME);
|
---|
1844 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWTime",
|
---|
1845 | &dcd.detailslwtime, sizeof(BOOL));
|
---|
1846 | dcd.detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE);
|
---|
1847 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsLADate",
|
---|
1848 | &dcd.detailsladate, sizeof(BOOL));
|
---|
1849 | dcd.detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME);
|
---|
1850 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsLATime",
|
---|
1851 | &dcd.detailslatime, sizeof(BOOL));
|
---|
1852 | dcd.detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE);
|
---|
1853 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRDate",
|
---|
1854 | &dcd.detailscrdate, sizeof(BOOL));
|
---|
1855 | dcd.detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME);
|
---|
1856 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRTime",
|
---|
1857 | &dcd.detailscrtime, sizeof(BOOL));
|
---|
1858 | dcd.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR);
|
---|
1859 | PrfWriteProfileData(fmprof, appname, "Collector.DetailsAttr",
|
---|
1860 | &dcd.detailsattr, sizeof(BOOL));
|
---|
1861 | *mask.prompt = 0;
|
---|
1862 | PrfWriteProfileData(fmprof,
|
---|
1863 | appname, "CollectorFilter", &mask, sizeof(MASK));
|
---|
1864 | }
|
---|
1865 | break;
|
---|
1866 | }
|
---|
1867 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
1868 | }
|
---|
1869 |
|
---|
1870 | MRESULT EXPENTRY Cfg8DlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
1871 | {
|
---|
1872 | switch (msg) {
|
---|
1873 | case WM_INITDLG:
|
---|
1874 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1875 | break;
|
---|
1876 |
|
---|
1877 | case UM_UNDO:
|
---|
1878 | WinCheckButton(hwnd, CFG6_SORTFIRST, FALSE);
|
---|
1879 | WinCheckButton(hwnd, CFG6_SORTLAST, FALSE);
|
---|
1880 | WinCheckButton(hwnd, CFG6_SORTSIZE, FALSE);
|
---|
1881 | WinCheckButton(hwnd, CFG6_SORTEASIZE, FALSE);
|
---|
1882 | WinCheckButton(hwnd, CFG6_SORTLWDATE, FALSE);
|
---|
1883 | WinCheckButton(hwnd, CFG6_SORTLADATE, FALSE);
|
---|
1884 | WinCheckButton(hwnd, CFG6_SORTCRDATE, FALSE);
|
---|
1885 | WinCheckButton(hwnd, CFG6_SORTNAME, FALSE);
|
---|
1886 | WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE);
|
---|
1887 | WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE);
|
---|
1888 | WinCheckButton(hwnd, CFG6_SORTREVERSE, FALSE);
|
---|
1889 | if (CollectorsortFlags & SORT_FIRSTEXTENSION)
|
---|
1890 | WinCheckButton(hwnd, CFG6_SORTFIRST, TRUE);
|
---|
1891 | else if (CollectorsortFlags & SORT_LASTEXTENSION)
|
---|
1892 | WinCheckButton(hwnd, CFG6_SORTLAST, TRUE);
|
---|
1893 | else if (CollectorsortFlags & SORT_SIZE)
|
---|
1894 | WinCheckButton(hwnd, CFG6_SORTSIZE, TRUE);
|
---|
1895 | else if (CollectorsortFlags & SORT_EASIZE)
|
---|
1896 | WinCheckButton(hwnd, CFG6_SORTEASIZE, TRUE);
|
---|
1897 | else if (CollectorsortFlags & SORT_LWDATE)
|
---|
1898 | WinCheckButton(hwnd, CFG6_SORTLWDATE, TRUE);
|
---|
1899 | else if (CollectorsortFlags & SORT_LADATE)
|
---|
1900 | WinCheckButton(hwnd, CFG6_SORTLADATE, TRUE);
|
---|
1901 | else if (CollectorsortFlags & SORT_CRDATE)
|
---|
1902 | WinCheckButton(hwnd, CFG6_SORTCRDATE, TRUE);
|
---|
1903 | else if (CollectorsortFlags & SORT_FILENAME)
|
---|
1904 | WinCheckButton(hwnd, CFG6_SORTFILENAME, TRUE);
|
---|
1905 | else
|
---|
1906 | WinCheckButton(hwnd, CFG6_SORTNAME, TRUE);
|
---|
1907 | if (CollectorsortFlags & SORT_DIRSFIRST)
|
---|
1908 | WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, TRUE);
|
---|
1909 | else if (CollectorsortFlags & SORT_DIRSLAST)
|
---|
1910 | WinCheckButton(hwnd, CFG6_SORTDIRSLAST, TRUE);
|
---|
1911 | if (CollectorsortFlags & SORT_REVERSE)
|
---|
1912 | WinCheckButton(hwnd, CFG6_SORTREVERSE, TRUE);
|
---|
1913 | return 0;
|
---|
1914 |
|
---|
1915 | case WM_CONTROL:
|
---|
1916 | switch (SHORT1FROMMP(mp1)) {
|
---|
1917 | case CFG6_SORTDIRSFIRST:
|
---|
1918 | case CFG6_SORTDIRSLAST:
|
---|
1919 | {
|
---|
1920 | BOOL temp;
|
---|
1921 |
|
---|
1922 | temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1));
|
---|
1923 | if (temp) {
|
---|
1924 | switch (SHORT1FROMMP(mp1)) {
|
---|
1925 | case CFG6_SORTDIRSFIRST:
|
---|
1926 | WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE);
|
---|
1927 | break;
|
---|
1928 | case CFG6_SORTDIRSLAST:
|
---|
1929 | WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE);
|
---|
1930 | break;
|
---|
1931 | }
|
---|
1932 | }
|
---|
1933 | }
|
---|
1934 | break;
|
---|
1935 | }
|
---|
1936 | return 0;
|
---|
1937 |
|
---|
1938 | case WM_COMMAND:
|
---|
1939 | switch (SHORT1FROMMP(mp1)) {
|
---|
1940 | case IDM_UNDO:
|
---|
1941 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1942 | break;
|
---|
1943 |
|
---|
1944 | case DID_CANCEL:
|
---|
1945 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
1946 |
|
---|
1947 | case DID_OK:
|
---|
1948 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
1949 | break;
|
---|
1950 |
|
---|
1951 | case IDM_HELP:
|
---|
1952 | if (hwndHelp)
|
---|
1953 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
1954 | MPFROM2SHORT(HELP_CFG8, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
1955 | break;
|
---|
1956 | }
|
---|
1957 | return 0;
|
---|
1958 |
|
---|
1959 | case WM_CLOSE:
|
---|
1960 | CollectorsortFlags = 0;
|
---|
1961 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTFILENAME))
|
---|
1962 | CollectorsortFlags |= SORT_FILENAME;
|
---|
1963 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTSIZE))
|
---|
1964 | CollectorsortFlags |= SORT_SIZE;
|
---|
1965 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTEASIZE))
|
---|
1966 | CollectorsortFlags |= SORT_EASIZE;
|
---|
1967 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTFIRST))
|
---|
1968 | CollectorsortFlags |= SORT_FIRSTEXTENSION;
|
---|
1969 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLAST))
|
---|
1970 | CollectorsortFlags |= SORT_LASTEXTENSION;
|
---|
1971 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLWDATE))
|
---|
1972 | CollectorsortFlags |= SORT_LWDATE;
|
---|
1973 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTLADATE))
|
---|
1974 | CollectorsortFlags |= SORT_LADATE;
|
---|
1975 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTCRDATE))
|
---|
1976 | CollectorsortFlags |= SORT_CRDATE;
|
---|
1977 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTDIRSFIRST))
|
---|
1978 | CollectorsortFlags |= SORT_DIRSFIRST;
|
---|
1979 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTDIRSLAST))
|
---|
1980 | CollectorsortFlags |= SORT_DIRSLAST;
|
---|
1981 | if (WinQueryButtonCheckstate(hwnd, CFG6_SORTREVERSE))
|
---|
1982 | CollectorsortFlags |= SORT_REVERSE;
|
---|
1983 | PrfWriteProfileData(fmprof,
|
---|
1984 | appname,
|
---|
1985 | "CollectorSort", &CollectorsortFlags, sizeof(INT));
|
---|
1986 | break;
|
---|
1987 | }
|
---|
1988 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
1989 | }
|
---|
1990 |
|
---|
1991 | MRESULT EXPENTRY Cfg9DlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
1992 | {
|
---|
1993 | switch (msg) {
|
---|
1994 | case WM_INITDLG:
|
---|
1995 | break;
|
---|
1996 |
|
---|
1997 | case WM_COMMAND:
|
---|
1998 | switch (SHORT1FROMMP(mp1)) {
|
---|
1999 | case IDM_HELP:
|
---|
2000 | if (hwndHelp)
|
---|
2001 | WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
|
---|
2002 | MPFROM2SHORT(HELP_CFG9, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
2003 | return 0;
|
---|
2004 | case CFG9_MAXIMUMUI:
|
---|
2005 | if (hwndMain) {
|
---|
2006 | if (MenuInvisible)
|
---|
2007 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2008 | MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID);
|
---|
2009 | if (!fAutoView)
|
---|
2010 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2011 | MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID);
|
---|
2012 | if (!fDrivebar)
|
---|
2013 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2014 | MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID);
|
---|
2015 | if (!fToolbar)
|
---|
2016 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2017 | MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID);
|
---|
2018 | if (!fMoreButtons)
|
---|
2019 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2020 | MPFROM2SHORT(IDM_MOREBUTTONS, 0), MPVOID);
|
---|
2021 | if (!fUserComboBox)
|
---|
2022 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2023 | MPFROM2SHORT(IDM_USERLIST, 0), MPVOID);
|
---|
2024 | }
|
---|
2025 | return 0;
|
---|
2026 | case CFG9_MINIMUMUI:
|
---|
2027 | if (hwndMain) {
|
---|
2028 | if (!MenuInvisible)
|
---|
2029 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2030 | MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID);
|
---|
2031 | if (fAutoView)
|
---|
2032 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2033 | MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID);
|
---|
2034 | if (fToolbar)
|
---|
2035 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2036 | MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID);
|
---|
2037 | if (fMoreButtons)
|
---|
2038 | WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_MOREBUTTONS, 0),
|
---|
2039 | MPVOID);
|
---|
2040 | if (fUserComboBox)
|
---|
2041 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2042 | MPFROM2SHORT(IDM_USERLIST, 0), MPVOID);
|
---|
2043 | saymsg(MB_ENTER | MB_ICONASTERISK,
|
---|
2044 | hwnd,
|
---|
2045 | GetPString(IDS_DONTFORGETTEXT),
|
---|
2046 | GetPString(IDS_UNHIDEMENUWARNTEXT));
|
---|
2047 | }
|
---|
2048 | return 0;
|
---|
2049 | case CFG9_MAXINFOPRETTY:
|
---|
2050 | fLoadSubject = TRUE;
|
---|
2051 | fLoadLongnames = TRUE;
|
---|
2052 | fNoIconsFiles = FALSE;
|
---|
2053 | fNoIconsDirs = FALSE;
|
---|
2054 | fForceUpper = FALSE;
|
---|
2055 | fForceLower = FALSE;
|
---|
2056 | fArcStuffVisible = TRUE;
|
---|
2057 | fSplitStatus = TRUE;
|
---|
2058 | fDragndropDlg = TRUE;
|
---|
2059 | {
|
---|
2060 | ULONG flWindowAttr;
|
---|
2061 |
|
---|
2062 | flWindowAttr = CV_DETAIL | CV_FLOW | CA_DETAILSVIEWTITLES;
|
---|
2063 | PrfWriteProfileData(fmprof,
|
---|
2064 | appname,
|
---|
2065 | "DirflWindowAttr", &flWindowAttr, sizeof(ULONG));
|
---|
2066 | PrfWriteProfileData(fmprof,
|
---|
2067 | appname,
|
---|
2068 | "CollectorflWindowAttr",
|
---|
2069 | &flWindowAttr, sizeof(ULONG));
|
---|
2070 | PrfWriteProfileData(fmprof, appname, "DirCnr.Fontnamesize", NULL, 0);
|
---|
2071 | PrfWriteProfileData(fmprof,
|
---|
2072 | appname, "Collector.Fontnamesize", NULL, 0);
|
---|
2073 | }
|
---|
2074 | detailslongname = TRUE;
|
---|
2075 | detailssubject = TRUE;
|
---|
2076 | detailsea = TRUE;
|
---|
2077 | detailssize = TRUE;
|
---|
2078 | detailsicon = TRUE;
|
---|
2079 | detailslwdate = TRUE;
|
---|
2080 | detailslwtime = TRUE;
|
---|
2081 | detailsladate = TRUE;
|
---|
2082 | detailslatime = TRUE;
|
---|
2083 | detailscrdate = TRUE;
|
---|
2084 | detailscrtime = TRUE;
|
---|
2085 | detailsattr = TRUE;
|
---|
2086 | if (hwndTree) {
|
---|
2087 |
|
---|
2088 | CNRINFO cnri;
|
---|
2089 | ULONG flWindowAttr = CV_TREE | CV_ICON | CV_FLOW | CA_TREELINE;
|
---|
2090 |
|
---|
2091 | memset(&cnri, 0, sizeof(cnri));
|
---|
2092 | cnri.cb = sizeof(cnri);
|
---|
2093 | WinSendMsg(WinWindowFromID
|
---|
2094 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2095 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2096 | cnri.flWindowAttr = flWindowAttr;
|
---|
2097 | WinSendMsg(WinWindowFromID
|
---|
2098 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2099 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
2100 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2101 | }
|
---|
2102 | break;
|
---|
2103 |
|
---|
2104 | case CFG9_MAXINFOPLAIN:
|
---|
2105 | fLoadSubject = TRUE;
|
---|
2106 | fLoadLongnames = TRUE;
|
---|
2107 | fNoIconsFiles = TRUE;
|
---|
2108 | fNoIconsDirs = TRUE;
|
---|
2109 | fForceUpper = FALSE;
|
---|
2110 | fForceLower = FALSE;
|
---|
2111 | fArcStuffVisible = TRUE;
|
---|
2112 | fSplitStatus = TRUE;
|
---|
2113 | fDragndropDlg = TRUE;
|
---|
2114 | {
|
---|
2115 | ULONG flWindowAttr;
|
---|
2116 |
|
---|
2117 | flWindowAttr = CV_DETAIL | CV_FLOW | CV_MINI;
|
---|
2118 | PrfWriteProfileData(fmprof,
|
---|
2119 | appname,
|
---|
2120 | "DirflWindowAttr", &flWindowAttr, sizeof(ULONG));
|
---|
2121 | PrfWriteProfileData(fmprof,
|
---|
2122 | appname,
|
---|
2123 | "CollectorflWindowAttr",
|
---|
2124 | &flWindowAttr, sizeof(ULONG));
|
---|
2125 | PrfWriteProfileData(fmprof,
|
---|
2126 | appname,
|
---|
2127 | "DirCnr.Fontnamesize",
|
---|
2128 | GetPString(IDS_8HELVTEXT),
|
---|
2129 | strlen(GetPString(IDS_8HELVTEXT)) + 1);
|
---|
2130 | PrfWriteProfileData(fmprof,
|
---|
2131 | appname,
|
---|
2132 | "Collector.Fontnamesize",
|
---|
2133 | GetPString(IDS_8HELVTEXT),
|
---|
2134 | strlen(GetPString(IDS_8HELVTEXT)) + 1);
|
---|
2135 | }
|
---|
2136 | detailslongname = TRUE;
|
---|
2137 | detailssubject = TRUE;
|
---|
2138 | detailsea = TRUE;
|
---|
2139 | detailssize = TRUE;
|
---|
2140 | detailsicon = TRUE;
|
---|
2141 | detailslwdate = TRUE;
|
---|
2142 | detailslwtime = TRUE;
|
---|
2143 | detailsladate = TRUE;
|
---|
2144 | detailslatime = TRUE;
|
---|
2145 | detailscrdate = TRUE;
|
---|
2146 | detailscrtime = TRUE;
|
---|
2147 | detailsattr = TRUE;
|
---|
2148 | if (hwndTree) {
|
---|
2149 |
|
---|
2150 | CNRINFO cnri;
|
---|
2151 | ULONG flWindowAttr = CV_TREE | CV_MINI | CV_TEXT |
|
---|
2152 | CV_FLOW | CA_TREELINE;
|
---|
2153 |
|
---|
2154 | memset(&cnri, 0, sizeof(cnri));
|
---|
2155 | cnri.cb = sizeof(cnri);
|
---|
2156 | WinSendMsg(WinWindowFromID
|
---|
2157 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2158 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2159 | cnri.flWindowAttr = flWindowAttr;
|
---|
2160 | WinSendMsg(WinWindowFromID
|
---|
2161 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2162 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
2163 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2164 | }
|
---|
2165 | break;
|
---|
2166 | case CFG9_MAXFILENAMES:
|
---|
2167 | if (hwndMain && fAutoView)
|
---|
2168 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2169 | MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID);
|
---|
2170 | fForceUpper = FALSE;
|
---|
2171 | fForceLower = TRUE;
|
---|
2172 | fExternalViewer = TRUE;
|
---|
2173 | fExternalArcboxes = TRUE;
|
---|
2174 | fExternalCollector = TRUE;
|
---|
2175 | fExternalINIs = TRUE;
|
---|
2176 | fLoadSubject = FALSE;
|
---|
2177 | fLoadLongnames = FALSE;
|
---|
2178 | fNoIconsFiles = TRUE;
|
---|
2179 | fNoIconsDirs = TRUE;
|
---|
2180 | {
|
---|
2181 | ULONG flWindowAttr;
|
---|
2182 |
|
---|
2183 | flWindowAttr = CV_TEXT | CV_FLOW;
|
---|
2184 | PrfWriteProfileData(fmprof, appname, "DirflWindowAttr",
|
---|
2185 | &flWindowAttr, sizeof(ULONG));
|
---|
2186 | PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr",
|
---|
2187 | &flWindowAttr, sizeof(ULONG));
|
---|
2188 | PrfWriteProfileData(fmprof, appname, "DirCnr.Fontnamesize",
|
---|
2189 | GetPString(IDS_8HELVTEXT),
|
---|
2190 | strlen(GetPString(IDS_8HELVTEXT)) + 1);
|
---|
2191 | PrfWriteProfileData(fmprof, appname, "Collector.Fontnamesize",
|
---|
2192 | GetPString(IDS_8HELVTEXT),
|
---|
2193 | strlen(GetPString(IDS_8HELVTEXT)) + 1);
|
---|
2194 | }
|
---|
2195 | if (hwndTree) {
|
---|
2196 |
|
---|
2197 | CNRINFO cnri;
|
---|
2198 | ULONG flWindowAttr = CV_TREE | CV_TEXT | CV_FLOW | CA_TREELINE;
|
---|
2199 |
|
---|
2200 | memset(&cnri, 0, sizeof(cnri));
|
---|
2201 | cnri.cb = sizeof(cnri);
|
---|
2202 | WinSendMsg(WinWindowFromID
|
---|
2203 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2204 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2205 | cnri.flWindowAttr = flWindowAttr;
|
---|
2206 | WinSendMsg(WinWindowFromID
|
---|
2207 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2208 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
2209 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2210 | }
|
---|
2211 | break;
|
---|
2212 | case CFG9_MAXSPEED:
|
---|
2213 | fLoadSubject = FALSE;
|
---|
2214 | fLoadLongnames = FALSE;
|
---|
2215 | fVerify = FALSE;
|
---|
2216 | DosSetVerify(FALSE);
|
---|
2217 | FilesToGet = FILESTOGET_MAX;
|
---|
2218 | fQuickArcFind = TRUE;
|
---|
2219 | fMinOnOpen = TRUE;
|
---|
2220 | fRealIdle = FALSE;
|
---|
2221 | fNoIconsFiles = TRUE;
|
---|
2222 | fNoIconsDirs = TRUE;
|
---|
2223 | fSyncUpdates = FALSE;
|
---|
2224 | fArcStuffVisible = FALSE;
|
---|
2225 | fForceUpper = FALSE;
|
---|
2226 | fForceLower = FALSE;
|
---|
2227 | detailslongname = FALSE;
|
---|
2228 | detailssubject = FALSE;
|
---|
2229 | break;
|
---|
2230 |
|
---|
2231 | case CFG9_HECTOR:
|
---|
2232 | fSwitchTree = TRUE;
|
---|
2233 | fSwitchTreeOnFocus = FALSE;
|
---|
2234 | fSwitchTreeExpand = TRUE;
|
---|
2235 | fCollapseFirst = TRUE;
|
---|
2236 | fSelectedAlways = FALSE;
|
---|
2237 | fTileBackwards = FALSE;
|
---|
2238 | fExternalViewer = FALSE;
|
---|
2239 | fExternalArcboxes = TRUE;
|
---|
2240 | fExternalCollector = FALSE;
|
---|
2241 | fExternalINIs = TRUE;
|
---|
2242 | fCopyDefault = FALSE;
|
---|
2243 | fFollowTree = FALSE;
|
---|
2244 | fLoadSubject = FALSE;
|
---|
2245 | fLoadLongnames = FALSE;
|
---|
2246 | fDontMoveMouse = FALSE;
|
---|
2247 | fUnHilite = TRUE;
|
---|
2248 | fUserListSwitches = TRUE;
|
---|
2249 | fDCOpens = FALSE;
|
---|
2250 | fLinkSetsIcon = FALSE;
|
---|
2251 | fConfirmDelete = TRUE;
|
---|
2252 | fSyncUpdates = FALSE;
|
---|
2253 | fRealIdle = FALSE;
|
---|
2254 | fNoIconsFiles = FALSE;
|
---|
2255 | fNoIconsDirs = TRUE;
|
---|
2256 | fFolderAfterExtract = FALSE;
|
---|
2257 | fVerify = TRUE;
|
---|
2258 | DosSetVerify(TRUE);
|
---|
2259 | fForceUpper = FALSE;
|
---|
2260 | fForceLower = TRUE;
|
---|
2261 | fArcStuffVisible = FALSE;
|
---|
2262 | fVTreeOpensWPS = FALSE;
|
---|
2263 | fRemoteBug = FALSE;
|
---|
2264 | fDragndropDlg = TRUE;
|
---|
2265 | fMinOnOpen = FALSE;
|
---|
2266 | fQuickArcFind = TRUE;
|
---|
2267 | fNoRemovableScan = TRUE;
|
---|
2268 | FilesToGet = FILESTOGET_MIN;
|
---|
2269 | fFreeTree = FALSE;
|
---|
2270 | fSplitStatus = TRUE;
|
---|
2271 | fAutoTile = TRUE;
|
---|
2272 | fSaveState = TRUE;
|
---|
2273 | fStartMinimized = FALSE;
|
---|
2274 | fStartMaximized = FALSE;
|
---|
2275 | fDataMin = FALSE;
|
---|
2276 | ulCnrType = CCS_EXTENDSEL | CCS_MULTIPLESEL;
|
---|
2277 | fNoTreeGap = TRUE;
|
---|
2278 | {
|
---|
2279 | ULONG flWindowAttr;
|
---|
2280 |
|
---|
2281 | flWindowAttr = (CV_NAME | CV_MINI | CV_FLOW | CA_DETAILSVIEWTITLES);
|
---|
2282 | PrfWriteProfileData(fmprof, appname, "DirflWindowAttr",
|
---|
2283 | &flWindowAttr, sizeof(ULONG));
|
---|
2284 | PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr",
|
---|
2285 | &flWindowAttr, sizeof(ULONG));
|
---|
2286 | }
|
---|
2287 | detailslongname = FALSE;
|
---|
2288 | detailssubject = FALSE;
|
---|
2289 | detailsea = TRUE;
|
---|
2290 | detailssize = TRUE;
|
---|
2291 | detailsicon = TRUE;
|
---|
2292 | detailslwdate = TRUE;
|
---|
2293 | detailslwtime = TRUE;
|
---|
2294 | detailsladate = FALSE;
|
---|
2295 | detailslatime = FALSE;
|
---|
2296 | detailscrdate = FALSE;
|
---|
2297 | detailscrtime = FALSE;
|
---|
2298 | detailsattr = TRUE;
|
---|
2299 | sortFlags = SORT_FILENAME | SORT_DIRSFIRST;
|
---|
2300 | CollectorsortFlags = SORT_FILENAME | SORT_DIRSFIRST;
|
---|
2301 | if (hwndMain) {
|
---|
2302 |
|
---|
2303 | SWP swp;
|
---|
2304 |
|
---|
2305 | if (WinQueryWindowPos(hwndMain, &swp)) {
|
---|
2306 | WinSetWindowPos(hwndTree, HWND_TOP, 0, 0,
|
---|
2307 | swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE);
|
---|
2308 | }
|
---|
2309 | }
|
---|
2310 | if (hwndMain) {
|
---|
2311 | if (MenuInvisible)
|
---|
2312 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2313 | MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID);
|
---|
2314 | if (fAutoView)
|
---|
2315 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2316 | MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID);
|
---|
2317 | if (fToolbar)
|
---|
2318 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2319 | MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID);
|
---|
2320 | if (!fDrivebar)
|
---|
2321 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2322 | MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID);
|
---|
2323 | if (!fMoreButtons)
|
---|
2324 | WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_MOREBUTTONS, 0),
|
---|
2325 | MPVOID);
|
---|
2326 | if (!fUserComboBox)
|
---|
2327 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2328 | MPFROM2SHORT(IDM_USERLIST, 0), MPVOID);
|
---|
2329 | }
|
---|
2330 | if (hwndTree) {
|
---|
2331 |
|
---|
2332 | CNRINFO cnri;
|
---|
2333 | ULONG flWindowAttr = (CV_TREE | CV_TEXT | CV_MINI |
|
---|
2334 | CV_FLOW | CA_TREELINE);
|
---|
2335 |
|
---|
2336 | memset(&cnri, 0, sizeof(cnri));
|
---|
2337 | cnri.cb = sizeof(cnri);
|
---|
2338 | WinSendMsg(WinWindowFromID
|
---|
2339 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2340 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2341 | cnri.flWindowAttr = flWindowAttr;
|
---|
2342 | WinSendMsg(WinWindowFromID
|
---|
2343 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2344 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
2345 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2346 | }
|
---|
2347 | break;
|
---|
2348 |
|
---|
2349 | case CFG9_DEFAULT:
|
---|
2350 | fSwitchTree = FALSE;
|
---|
2351 | fSwitchTreeOnFocus = FALSE;
|
---|
2352 | fSwitchTreeExpand = FALSE;
|
---|
2353 | fCollapseFirst = FALSE;
|
---|
2354 | fSelectedAlways = FALSE;
|
---|
2355 | fTileBackwards = FALSE;
|
---|
2356 | fExternalViewer = FALSE;
|
---|
2357 | fExternalArcboxes = FALSE;
|
---|
2358 | fExternalCollector = FALSE;
|
---|
2359 | fExternalINIs = FALSE;
|
---|
2360 | fCopyDefault = FALSE;
|
---|
2361 | fFollowTree = FALSE;
|
---|
2362 | fLoadSubject = TRUE;
|
---|
2363 | fLoadLongnames = TRUE;
|
---|
2364 | fDontMoveMouse = FALSE;
|
---|
2365 | fUnHilite = TRUE;
|
---|
2366 | fUserListSwitches = FALSE;
|
---|
2367 | fDCOpens = FALSE;
|
---|
2368 | fLinkSetsIcon = FALSE;
|
---|
2369 | fConfirmDelete = TRUE;
|
---|
2370 | fSyncUpdates = FALSE;
|
---|
2371 | fRealIdle = FALSE;
|
---|
2372 | fNoIconsFiles = FALSE;
|
---|
2373 | fNoIconsDirs = FALSE;
|
---|
2374 | fFolderAfterExtract = FALSE;
|
---|
2375 | fVerify = TRUE;
|
---|
2376 | fNoSearch = TRUE;
|
---|
2377 | DosSetVerify(TRUE);
|
---|
2378 | fForceUpper = FALSE;
|
---|
2379 | fForceLower = TRUE;
|
---|
2380 | fArcStuffVisible = TRUE;
|
---|
2381 | fVTreeOpensWPS = FALSE;
|
---|
2382 | fRemoteBug = TRUE;
|
---|
2383 | fDragndropDlg = TRUE;
|
---|
2384 | fMinOnOpen = FALSE;
|
---|
2385 | fQuickArcFind = TRUE;
|
---|
2386 | fNoRemovableScan = FALSE;
|
---|
2387 | FilesToGet = FILESTOGET_MAX;
|
---|
2388 | fFreeTree = FALSE;
|
---|
2389 | fSplitStatus = TRUE;
|
---|
2390 | fAutoTile = TRUE;
|
---|
2391 | fSaveState = TRUE;
|
---|
2392 | fStartMinimized = FALSE;
|
---|
2393 | fStartMaximized = FALSE;
|
---|
2394 | fDataMin = TRUE;
|
---|
2395 | ulCnrType = CCS_EXTENDSEL;
|
---|
2396 | fNoTreeGap = FALSE;
|
---|
2397 | {
|
---|
2398 | ULONG flWindowAttr;
|
---|
2399 |
|
---|
2400 | flWindowAttr = (CV_NAME | CV_MINI | CV_FLOW | CA_DETAILSVIEWTITLES);
|
---|
2401 | PrfWriteProfileData(fmprof, appname, "DirflWindowAttr",
|
---|
2402 | &flWindowAttr, sizeof(ULONG));
|
---|
2403 | PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr",
|
---|
2404 | &flWindowAttr, sizeof(ULONG));
|
---|
2405 | }
|
---|
2406 | detailslongname = FALSE;
|
---|
2407 | detailssubject = FALSE;
|
---|
2408 | detailsea = TRUE;
|
---|
2409 | detailssize = TRUE;
|
---|
2410 | detailsicon = TRUE;
|
---|
2411 | detailslwdate = TRUE;
|
---|
2412 | detailslwtime = TRUE;
|
---|
2413 | detailsladate = FALSE;
|
---|
2414 | detailslatime = FALSE;
|
---|
2415 | detailscrdate = FALSE;
|
---|
2416 | detailscrtime = FALSE;
|
---|
2417 | detailsattr = TRUE;
|
---|
2418 | sortFlags = SORT_FILENAME | SORT_DIRSFIRST;
|
---|
2419 | CollectorsortFlags = SORT_FILENAME | SORT_DIRSFIRST;
|
---|
2420 | if (hwndMain) {
|
---|
2421 |
|
---|
2422 | SWP swp;
|
---|
2423 |
|
---|
2424 | if (WinQueryWindowPos(hwndMain, &swp)) {
|
---|
2425 | WinSetWindowPos(hwndTree, HWND_TOP, 0, 0,
|
---|
2426 | swp.cx / 5,
|
---|
2427 | swp.cy -
|
---|
2428 | (WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2),
|
---|
2429 | SWP_MOVE | SWP_SIZE);
|
---|
2430 | }
|
---|
2431 | }
|
---|
2432 | if (hwndTree) {
|
---|
2433 |
|
---|
2434 | CNRINFO cnri;
|
---|
2435 | ULONG flWindowAttr = (CV_TREE | CV_TEXT |
|
---|
2436 | CV_FLOW | CA_TREELINE | CV_MINI);
|
---|
2437 |
|
---|
2438 | memset(&cnri, 0, sizeof(cnri));
|
---|
2439 | cnri.cb = sizeof(cnri);
|
---|
2440 | WinSendMsg(WinWindowFromID
|
---|
2441 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2442 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2443 | cnri.flWindowAttr = flWindowAttr;
|
---|
2444 | WinSendMsg(WinWindowFromID
|
---|
2445 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2446 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
2447 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2448 | }
|
---|
2449 | break;
|
---|
2450 |
|
---|
2451 | case CFG9_WINDOZETHINK:
|
---|
2452 | fTileBackwards = FALSE;
|
---|
2453 | ulCnrType = CCS_MULTIPLESEL;
|
---|
2454 | fFollowTree = TRUE;
|
---|
2455 | fTopDir = FALSE;
|
---|
2456 | fSwitchTree = TRUE;
|
---|
2457 | fSwitchTreeOnFocus = FALSE;
|
---|
2458 | fSwitchTreeExpand = TRUE;
|
---|
2459 | fCollapseFirst = TRUE;
|
---|
2460 | fDCOpens = FALSE;
|
---|
2461 | {
|
---|
2462 | ULONG flWindowAttr;
|
---|
2463 |
|
---|
2464 | flWindowAttr = CV_NAME | CV_FLOW | CA_DETAILSVIEWTITLES;
|
---|
2465 | PrfWriteProfileData(fmprof, appname, "DirflWindowAttr",
|
---|
2466 | &flWindowAttr, sizeof(ULONG));
|
---|
2467 | PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr",
|
---|
2468 | &flWindowAttr, sizeof(ULONG));
|
---|
2469 | }
|
---|
2470 | fLinkSetsIcon = FALSE;
|
---|
2471 | fFreeTree = FALSE;
|
---|
2472 | fNoTreeGap = TRUE;
|
---|
2473 | fExternalArcboxes = TRUE;
|
---|
2474 | fExternalViewer = TRUE;
|
---|
2475 | fExternalCollector = TRUE;
|
---|
2476 | fExternalINIs = TRUE;
|
---|
2477 | fUserListSwitches = TRUE;
|
---|
2478 | WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), UM_UNDO, MPVOID,
|
---|
2479 | MPVOID);
|
---|
2480 | if (hwndTree) {
|
---|
2481 |
|
---|
2482 | CNRINFO cnri;
|
---|
2483 | ULONG flWindowAttr = CV_TREE | CV_MINI | CV_ICON |
|
---|
2484 | CV_FLOW | CA_TREELINE;
|
---|
2485 |
|
---|
2486 | memset(&cnri, 0, sizeof(cnri));
|
---|
2487 | cnri.cb = sizeof(cnri);
|
---|
2488 | WinSendMsg(WinWindowFromID
|
---|
2489 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2490 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2491 | cnri.flWindowAttr = flWindowAttr;
|
---|
2492 | WinSendMsg(WinWindowFromID
|
---|
2493 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2494 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
2495 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2496 | }
|
---|
2497 | if (hwndMain) {
|
---|
2498 | if (fAutoView)
|
---|
2499 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2500 | MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID);
|
---|
2501 | if (!fDrivebar)
|
---|
2502 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2503 | MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID);
|
---|
2504 | {
|
---|
2505 | SWP swp;
|
---|
2506 |
|
---|
2507 | if (WinQueryWindowPos(hwndMain, &swp)) {
|
---|
2508 | WinSetWindowPos(hwndTree, HWND_TOP, 0, 0,
|
---|
2509 | swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE);
|
---|
2510 | }
|
---|
2511 | }
|
---|
2512 | PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2L));
|
---|
2513 | PostMsg(MainObjectHwnd, UM_SETDIR, MPFROMLONG(1L), MPVOID);
|
---|
2514 | }
|
---|
2515 | return 0;
|
---|
2516 |
|
---|
2517 | case CFG9_DOSTHINK:
|
---|
2518 | fTileBackwards = TRUE;
|
---|
2519 | ulCnrType = CCS_MULTIPLESEL;
|
---|
2520 | fSwitchTree = TRUE;
|
---|
2521 | fSwitchTreeOnFocus = FALSE;
|
---|
2522 | fSwitchTreeExpand = TRUE;
|
---|
2523 | fCollapseFirst = TRUE;
|
---|
2524 | fFollowTree = TRUE;
|
---|
2525 | fTopDir = FALSE;
|
---|
2526 | if (hwndMain) {
|
---|
2527 | if (!fTextTools)
|
---|
2528 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2529 | MPFROM2SHORT(IDM_TEXTTOOLS, 0), MPVOID);
|
---|
2530 | }
|
---|
2531 | {
|
---|
2532 | ULONG flWindowAttr;
|
---|
2533 |
|
---|
2534 | flWindowAttr = CV_TEXT | CV_FLOW | CA_DETAILSVIEWTITLES;
|
---|
2535 | PrfWriteProfileData(fmprof, appname, "DirflWindowAttr",
|
---|
2536 | &flWindowAttr, sizeof(ULONG));
|
---|
2537 | PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr",
|
---|
2538 | &flWindowAttr, sizeof(ULONG));
|
---|
2539 | }
|
---|
2540 | if (hwndTree) {
|
---|
2541 |
|
---|
2542 | CNRINFO cnri;
|
---|
2543 | ULONG flWindowAttr = CV_TREE | CV_TEXT | CV_FLOW | CA_TREELINE;
|
---|
2544 |
|
---|
2545 | memset(&cnri, 0, sizeof(cnri));
|
---|
2546 | cnri.cb = sizeof(cnri);
|
---|
2547 | WinSendMsg(WinWindowFromID
|
---|
2548 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2549 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2550 | cnri.flWindowAttr = flWindowAttr;
|
---|
2551 | WinSendMsg(WinWindowFromID
|
---|
2552 | (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),
|
---|
2553 | CM_SETCNRINFO, MPFROMP(&cnri),
|
---|
2554 | MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2555 | }
|
---|
2556 | /* intentional fallthru */
|
---|
2557 | case CFG9_1X:
|
---|
2558 | if (SHORT1FROMMP(mp1) == CFG9_1X) {
|
---|
2559 | fTileBackwards = FALSE;
|
---|
2560 | ulCnrType = CCS_MULTIPLESEL | CCS_EXTENDSEL;
|
---|
2561 | fSwitchTree = FALSE;
|
---|
2562 | fSwitchTreeOnFocus = FALSE;
|
---|
2563 | fSwitchTreeExpand = FALSE;
|
---|
2564 | fCollapseFirst = FALSE;
|
---|
2565 | fFollowTree = FALSE;
|
---|
2566 | fNoSearch = TRUE;
|
---|
2567 | }
|
---|
2568 | fAutoTile = TRUE;
|
---|
2569 | fSaveState = TRUE;
|
---|
2570 | fDCOpens = FALSE;
|
---|
2571 | fLinkSetsIcon = FALSE;
|
---|
2572 | fFreeTree = FALSE;
|
---|
2573 | fNoTreeGap = TRUE;
|
---|
2574 | fExternalArcboxes = TRUE;
|
---|
2575 | fExternalViewer = TRUE;
|
---|
2576 | fExternalCollector = TRUE;
|
---|
2577 | fExternalINIs = TRUE;
|
---|
2578 | fUserListSwitches = TRUE;
|
---|
2579 | WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), UM_UNDO, MPVOID,
|
---|
2580 | MPVOID);
|
---|
2581 | if (hwndTree) {
|
---|
2582 |
|
---|
2583 | CNRINFO cnri;
|
---|
2584 | ULONG flWindowAttr = CV_TREE | CV_ICON | CV_FLOW | CA_TREELINE;
|
---|
2585 |
|
---|
2586 | memset(&cnri, 0, sizeof(cnri));
|
---|
2587 | cnri.cb = sizeof(cnri);
|
---|
2588 | WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, FID_CLIENT),
|
---|
2589 | TREE_CNR),
|
---|
2590 | CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri)));
|
---|
2591 | cnri.flWindowAttr = flWindowAttr;
|
---|
2592 | WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, FID_CLIENT),
|
---|
2593 | TREE_CNR),
|
---|
2594 | CM_SETCNRINFO,
|
---|
2595 | MPFROMP(&cnri), MPFROMLONG(CMA_FLWINDOWATTR));
|
---|
2596 | }
|
---|
2597 | if (hwndMain) {
|
---|
2598 | if (fAutoView)
|
---|
2599 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2600 | MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID);
|
---|
2601 | if (fUserComboBox)
|
---|
2602 | WinSendMsg(hwndMain, WM_COMMAND,
|
---|
2603 | MPFROM2SHORT(IDM_USERLIST, 0), MPVOID);
|
---|
2604 | {
|
---|
2605 | SWP swp;
|
---|
2606 |
|
---|
2607 | if (WinQueryWindowPos(hwndMain, &swp)) {
|
---|
2608 | WinSetWindowPos(hwndTree, HWND_TOP, 0, 0,
|
---|
2609 | swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE);
|
---|
2610 | }
|
---|
2611 | }
|
---|
2612 | PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2L));
|
---|
2613 | PostMsg(MainObjectHwnd, UM_SETDIR, MPVOID, MPVOID);
|
---|
2614 | }
|
---|
2615 | return 0;
|
---|
2616 |
|
---|
2617 | case DID_CANCEL:
|
---|
2618 | WinSendMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
2619 |
|
---|
2620 | case DID_OK:
|
---|
2621 | PostMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), msg, mp1, mp2);
|
---|
2622 | return 0;
|
---|
2623 |
|
---|
2624 | default:
|
---|
2625 | return 0;
|
---|
2626 | }
|
---|
2627 | PrfWriteProfileData(fmprof, appname, "DetailsLongname",
|
---|
2628 | &detailslongname, sizeof(BOOL));
|
---|
2629 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname",
|
---|
2630 | // &detailslongname, sizeof(BOOL));
|
---|
2631 | PrfWriteProfileData(fmprof, appname, "DetailsSubject",
|
---|
2632 | &detailssubject, sizeof(BOOL));
|
---|
2633 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject",
|
---|
2634 | // &detailssubject, sizeof(BOOL));
|
---|
2635 | PrfWriteProfileData(fmprof, appname, "DetailsEA",
|
---|
2636 | &detailsea, sizeof(BOOL));
|
---|
2637 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA",
|
---|
2638 | // &detailsea, sizeof(BOOL));
|
---|
2639 | PrfWriteProfileData(fmprof, appname, "DetailsSize",
|
---|
2640 | &detailssize, sizeof(BOOL));
|
---|
2641 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize",
|
---|
2642 | // &detailssize, sizeof(BOOL));
|
---|
2643 | PrfWriteProfileData(fmprof, appname, "DetailsIcon",
|
---|
2644 | &detailsicon, sizeof(BOOL));
|
---|
2645 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon",
|
---|
2646 | // &detailsicon, sizeof(BOOL));
|
---|
2647 | PrfWriteProfileData(fmprof, appname, "DetailsLWDate",
|
---|
2648 | &detailslwdate, sizeof(BOOL));
|
---|
2649 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate",
|
---|
2650 | // &detailslwdate, sizeof(BOOL));
|
---|
2651 | PrfWriteProfileData(fmprof, appname, "DetailsLWTime",
|
---|
2652 | &detailslwtime, sizeof(BOOL));
|
---|
2653 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime",
|
---|
2654 | // &detailslwtime, sizeof(BOOL));
|
---|
2655 | PrfWriteProfileData(fmprof, appname, "DetailsLADate",
|
---|
2656 | &detailsladate, sizeof(BOOL));
|
---|
2657 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate",
|
---|
2658 | // &detailsladate, sizeof(BOOL));
|
---|
2659 | PrfWriteProfileData(fmprof, appname, "DetailsLATime",
|
---|
2660 | &detailslatime, sizeof(BOOL));
|
---|
2661 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime",
|
---|
2662 | // &detailslatime, sizeof(BOOL));
|
---|
2663 | PrfWriteProfileData(fmprof, appname, "DetailsCRDate",
|
---|
2664 | &detailscrdate, sizeof(BOOL));
|
---|
2665 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate",
|
---|
2666 | // &detailscrdate, sizeof(BOOL));
|
---|
2667 | PrfWriteProfileData(fmprof, appname, "DetailsCRTime",
|
---|
2668 | &detailscrtime, sizeof(BOOL));
|
---|
2669 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime",
|
---|
2670 | // &detailscrtime, sizeof(BOOL));
|
---|
2671 | PrfWriteProfileData(fmprof, appname, "DetailsAttr",
|
---|
2672 | &detailsattr, sizeof(BOOL));
|
---|
2673 | // PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr",
|
---|
2674 | // &detailsattr, sizeof(BOOL));
|
---|
2675 | if (hwndMain) {
|
---|
2676 | if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) {
|
---|
2677 | PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2));
|
---|
2678 | PostMsg(hwndMain, UM_RESTORE, MPVOID, MPVOID);
|
---|
2679 | }
|
---|
2680 | }
|
---|
2681 | WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER),
|
---|
2682 | UM_UNDO, MPVOID, MPVOID);
|
---|
2683 | return 0;
|
---|
2684 |
|
---|
2685 | case WM_CLOSE:
|
---|
2686 | break;
|
---|
2687 | }
|
---|
2688 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
2689 | }
|
---|
2690 |
|
---|
2691 | NOTEPAGES np[] = { CFGD_FRAME,
|
---|
2692 | IDS_NOTEDIRCNRS1TEXT,
|
---|
2693 | CfgDDlgProc,
|
---|
2694 | 0,
|
---|
2695 | 0,
|
---|
2696 | 0,
|
---|
2697 | CFG5_FRAME,
|
---|
2698 | IDS_NOTEDIRVIEW1TEXT,
|
---|
2699 | Cfg5DlgProc,
|
---|
2700 | 0,
|
---|
2701 | 0,
|
---|
2702 | 0,
|
---|
2703 | CFG6_FRAME,
|
---|
2704 | IDS_NOTEDIRSORT1TEXT,
|
---|
2705 | Cfg6DlgProc,
|
---|
2706 | 0,
|
---|
2707 | 0,
|
---|
2708 | 0,
|
---|
2709 | CFG5_FRAME,
|
---|
2710 | IDS_NOTECOLVIEW1TEXT,
|
---|
2711 | Cfg7DlgProc,
|
---|
2712 | 0,
|
---|
2713 | 0,
|
---|
2714 | 0,
|
---|
2715 | CFG6_FRAME,
|
---|
2716 | IDS_NOTECOLSORT1TEXT,
|
---|
2717 | Cfg8DlgProc,
|
---|
2718 | 0,
|
---|
2719 | 0,
|
---|
2720 | 0,
|
---|
2721 | CFGA_FRAME,
|
---|
2722 | IDS_NOTEARCHIVER1TEXT,
|
---|
2723 | CfgADlgProc,
|
---|
2724 | 0,
|
---|
2725 | 0,
|
---|
2726 | 0,
|
---|
2727 | CFGT_FRAME,
|
---|
2728 | IDS_NOTETREE1TEXT,
|
---|
2729 | CfgTDlgProc,
|
---|
2730 | 0,
|
---|
2731 | 0,
|
---|
2732 | 0,
|
---|
2733 | CFGTS_FRAME,
|
---|
2734 | IDS_NOTETREESORT1TEXT,
|
---|
2735 | CfgTSDlgProc,
|
---|
2736 | 0,
|
---|
2737 | 0,
|
---|
2738 | 0,
|
---|
2739 | CFGV_FRAME,
|
---|
2740 | IDS_NOTEVIEWERS1TEXT,
|
---|
2741 | CfgVDlgProc,
|
---|
2742 | 0,
|
---|
2743 | 0,
|
---|
2744 | 0,
|
---|
2745 | CFGC_FRAME,
|
---|
2746 | IDS_NOTECOMPARE1TEXT,
|
---|
2747 | CfgCDlgProc,
|
---|
2748 | 0,
|
---|
2749 | 0,
|
---|
2750 | 0,
|
---|
2751 | CFGM_FRAME,
|
---|
2752 | IDS_NOTEMONOLITHIC1TEXT,
|
---|
2753 | CfgMDlgProc,
|
---|
2754 | 0,
|
---|
2755 | 0,
|
---|
2756 | 0,
|
---|
2757 | CFGG_FRAME,
|
---|
2758 | IDS_NOTEGENERAL1TEXT,
|
---|
2759 | CfgGDlgProc,
|
---|
2760 | 0,
|
---|
2761 | 0,
|
---|
2762 | 0,
|
---|
2763 | CFGS_FRAME,
|
---|
2764 | IDS_NOTESCANNING1TEXT,
|
---|
2765 | CfgSDlgProc,
|
---|
2766 | 0,
|
---|
2767 | 0,
|
---|
2768 | 0,
|
---|
2769 | CFGB_FRAME,
|
---|
2770 | IDS_NOTEBUBBLE1TEXT,
|
---|
2771 | CfgBDlgProc,
|
---|
2772 | 0,
|
---|
2773 | 0,
|
---|
2774 | 0,
|
---|
2775 | CFG9_FRAME,
|
---|
2776 | IDS_NOTEQUICK1TEXT,
|
---|
2777 | Cfg9DlgProc,
|
---|
2778 | 0,
|
---|
2779 | 0,
|
---|
2780 | 0,
|
---|
2781 | 0,
|
---|
2782 | 0,
|
---|
2783 | NULL,
|
---|
2784 | 0,
|
---|
2785 | 0,
|
---|
2786 | 0
|
---|
2787 | };
|
---|
2788 |
|
---|
2789 | MRESULT EXPENTRY CfgDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
2790 | {
|
---|
2791 | HWND hwndTemp;
|
---|
2792 | USHORT attrib = BKA_FIRST;
|
---|
2793 | INT x;
|
---|
2794 | ULONG pageID;
|
---|
2795 |
|
---|
2796 | switch (msg) {
|
---|
2797 | case WM_INITDLG:
|
---|
2798 | hwndNotebook = hwnd;
|
---|
2799 | if (mp2) {
|
---|
2800 | if (!strcmp((CHAR *) mp2, "FM/4")) {
|
---|
2801 | x = 0;
|
---|
2802 | while (np[x].frameid && np[x].frameid != CFG9_FRAME)
|
---|
2803 | x++;
|
---|
2804 | np[x].frameid = 0;
|
---|
2805 | }
|
---|
2806 | }
|
---|
2807 | PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
|
---|
2808 | WinSendDlgItemMsg(hwnd,
|
---|
2809 | CFG_NOTEBOOK,
|
---|
2810 | BKM_SETDIMENSIONS,
|
---|
2811 | MPFROM2SHORT(82, 24), MPFROMLONG(BKA_MAJORTAB));
|
---|
2812 | WinSendDlgItemMsg(hwnd,
|
---|
2813 | CFG_NOTEBOOK,
|
---|
2814 | BKM_SETDIMENSIONS,
|
---|
2815 | MPFROM2SHORT(20, 20), MPFROMLONG(BKA_PAGEBUTTON));
|
---|
2816 | WinSendDlgItemMsg(hwnd,
|
---|
2817 | CFG_NOTEBOOK,
|
---|
2818 | BKM_SETDIMENSIONS,
|
---|
2819 | MPFROM2SHORT(0, 0), MPFROMLONG(BKA_MINORTAB));
|
---|
2820 | for (x = 0; np[x].frameid; x++) {
|
---|
2821 | hwndTemp = WinLoadDlg(HWND_DESKTOP,
|
---|
2822 | HWND_DESKTOP,
|
---|
2823 | np[x].proc, FM3ModHandle, np[x].frameid, MPVOID);
|
---|
2824 | if (hwndTemp) {
|
---|
2825 | WinSetWindowULong(hwndTemp, QWL_USER, (ULONG) hwnd);
|
---|
2826 | np[x].hwnd = hwndTemp;
|
---|
2827 | np[x].pageID = (ULONG) WinSendDlgItemMsg(hwnd,
|
---|
2828 | CFG_NOTEBOOK,
|
---|
2829 | BKM_INSERTPAGE,
|
---|
2830 | MPFROMLONG(BKA_FIRST),
|
---|
2831 | MPFROM2SHORT(BKA_AUTOPAGESIZE
|
---|
2832 | |
|
---|
2833 | BKA_STATUSTEXTON
|
---|
2834 | | BKA_MAJOR,
|
---|
2835 | attrib));
|
---|
2836 | attrib = BKA_LAST;
|
---|
2837 | WinSendDlgItemMsg(hwnd,
|
---|
2838 | CFG_NOTEBOOK,
|
---|
2839 | BKM_SETPAGEWINDOWHWND,
|
---|
2840 | MPFROMLONG(np[x].pageID), MPFROMLONG(np[x].hwnd));
|
---|
2841 | WinSendDlgItemMsg(hwnd,
|
---|
2842 | CFG_NOTEBOOK,
|
---|
2843 | BKM_SETTABTEXT,
|
---|
2844 | MPFROMLONG(np[x].pageID),
|
---|
2845 | MPFROMP(GetPString(np[x].title)));
|
---|
2846 | WinSendDlgItemMsg(hwnd,
|
---|
2847 | CFG_NOTEBOOK,
|
---|
2848 | BKM_SETSTATUSLINETEXT,
|
---|
2849 | MPFROMLONG(np[x].pageID),
|
---|
2850 | MPFROMP(GetPString(np[x].title + 1)));
|
---|
2851 | }
|
---|
2852 | }
|
---|
2853 | /* see if we've been asked to display quick cfg page */
|
---|
2854 | if (!mp2 ||
|
---|
2855 | strcmp((CHAR *) mp2, "First Time") ||
|
---|
2856 | !x || !np[x - 1].hwnd || !np[x - 1].pageID) {
|
---|
2857 | PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK),
|
---|
2858 | BKM_TURNTOPAGE, MPFROMLONG(np[0].pageID), MPVOID);
|
---|
2859 | }
|
---|
2860 | else {
|
---|
2861 | PostMsg(MainObjectHwnd, UM_SETDIR, MPFROMLONG(1L), MPVOID);
|
---|
2862 | PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK),
|
---|
2863 | BKM_TURNTOPAGE, MPFROMLONG(np[x - 1].pageID), MPVOID);
|
---|
2864 | PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(np[x - 1].hwnd), MPVOID);
|
---|
2865 | PostMsg(np[x - 1].hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID);
|
---|
2866 | }
|
---|
2867 | break;
|
---|
2868 |
|
---|
2869 | case UM_FOCUSME:
|
---|
2870 | if (mp1)
|
---|
2871 | WinSetActiveWindow(HWND_DESKTOP, (HWND) mp1);
|
---|
2872 | break;
|
---|
2873 |
|
---|
2874 | case WM_CONTROL:
|
---|
2875 | switch (SHORT1FROMMP(mp1)) {
|
---|
2876 | case CFG_NOTEBOOK:
|
---|
2877 | switch (SHORT2FROMMP(mp1)) {
|
---|
2878 | case BKN_PAGESELECTED:
|
---|
2879 | if (mp2) {
|
---|
2880 |
|
---|
2881 | PAGESELECTNOTIFY *psn = mp2;
|
---|
2882 |
|
---|
2883 | WinSendDlgItemMsg(hwnd,
|
---|
2884 | CFG_NOTEBOOK,
|
---|
2885 | BKM_QUERYPAGEWINDOWHWND,
|
---|
2886 | MPFROMLONG(psn->ulPageIdNew), MPVOID);
|
---|
2887 | }
|
---|
2888 | break;
|
---|
2889 | }
|
---|
2890 | break;
|
---|
2891 | }
|
---|
2892 | return 0;
|
---|
2893 |
|
---|
2894 | case UM_SETUP:
|
---|
2895 | WinSetActiveWindow(HWND_DESKTOP, WinQueryWindow(hwnd, QW_OWNER));
|
---|
2896 | WinSetActiveWindow(HWND_DESKTOP, hwnd);
|
---|
2897 | return 0;
|
---|
2898 |
|
---|
2899 | case WM_COMMAND:
|
---|
2900 | switch (SHORT1FROMMP(mp1)) {
|
---|
2901 | case DID_OK:
|
---|
2902 | WinDismissDlg(hwnd, 1);
|
---|
2903 | break;
|
---|
2904 |
|
---|
2905 | case DID_CANCEL:
|
---|
2906 | // Tell current page to undo itself in case changed and still alive
|
---|
2907 | pageID = (ULONG) WinSendDlgItemMsg(hwnd,
|
---|
2908 | CFG_NOTEBOOK,
|
---|
2909 | BKM_QUERYPAGEID,
|
---|
2910 | MPFROMLONG(0),
|
---|
2911 | MPFROM2SHORT(BKA_TOP, 0));
|
---|
2912 | hwndTemp = (HWND) WinSendDlgItemMsg(hwnd,
|
---|
2913 | CFG_NOTEBOOK,
|
---|
2914 | BKM_QUERYPAGEWINDOWHWND,
|
---|
2915 | MPFROMLONG(pageID), MPVOID);
|
---|
2916 | if (hwndTemp)
|
---|
2917 | WinSendMsg(hwndTemp, UM_UNDO, MPVOID, MPVOID);
|
---|
2918 |
|
---|
2919 | WinDismissDlg(hwnd, 0);
|
---|
2920 | break;
|
---|
2921 |
|
---|
2922 | case IDM_HELP: /* relay message to appropriate page's window */
|
---|
2923 | pageID = (ULONG) WinSendDlgItemMsg(hwnd,
|
---|
2924 | CFG_NOTEBOOK,
|
---|
2925 | BKM_QUERYPAGEID,
|
---|
2926 | MPFROMLONG(0),
|
---|
2927 | MPFROM2SHORT(BKA_TOP, 0));
|
---|
2928 | hwndTemp = (HWND) WinSendDlgItemMsg(hwnd,
|
---|
2929 | CFG_NOTEBOOK,
|
---|
2930 | BKM_QUERYPAGEWINDOWHWND,
|
---|
2931 | MPFROMLONG(pageID), MPVOID);
|
---|
2932 | if (hwndTemp)
|
---|
2933 | PostMsg(hwndTemp, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID);
|
---|
2934 | break;
|
---|
2935 | }
|
---|
2936 | return 0;
|
---|
2937 |
|
---|
2938 | case UM_UNDO:
|
---|
2939 | for (x = 0; np[x].frameid; x++) {
|
---|
2940 | if (np[x].hwnd)
|
---|
2941 | WinSendMsg(np[x].hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
2942 | }
|
---|
2943 | break;
|
---|
2944 |
|
---|
2945 | case WM_DESTROY:
|
---|
2946 | if (np[0].frameid) {
|
---|
2947 | for (x = 1; np[x].frameid; x++) {
|
---|
2948 | if (np[x].hwnd) {
|
---|
2949 | WinSendMsg(np[x].hwnd, WM_CLOSE, MPVOID, MPVOID);
|
---|
2950 | np[x].hwnd = (HWND) 0;
|
---|
2951 | np[x].pageID = 0;
|
---|
2952 | }
|
---|
2953 | }
|
---|
2954 | WinSendMsg(np[0].hwnd, WM_CLOSE, MPVOID, MPVOID);
|
---|
2955 | np[0].hwnd = (HWND) 0;
|
---|
2956 | np[0].pageID = 0;
|
---|
2957 | }
|
---|
2958 | hwndNotebook = (HWND) 0;
|
---|
2959 | break;
|
---|
2960 | }
|
---|
2961 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
2962 | }
|
---|
2963 |
|
---|
2964 | #pragma alloc_text(NOTEBOOK,CfgTDlgProc,CfgTSDlgProc,CfgMDlgProc)
|
---|
2965 | #pragma alloc_text(NOTEBOOK2,CfgADlgProc,CfgSDlgProc,CfgVDlgProc)
|
---|
2966 | #pragma alloc_text(NOTEBOOK3,CfgDDlgProc,Cfg5DlgProc,Cfg6DlgProc)
|
---|
2967 | #pragma alloc_text(NOTEBOOK4,Cfg7DlgProc,Cfg8DlgProc,CfgCDlgProc)
|
---|
2968 | #pragma alloc_text(NOTEBOOK5,CfgGDlgProc,CfgDlgProc,CfgBDlgProc)
|
---|
2969 |
|
---|