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