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