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