source: trunk/dll/select.c@ 897

Last change on this file since 897 was 897, checked in by Gregg Young, 18 years ago

Use CommaFmtULL for additional file, EA etc sizes display; Modify/Create TestFDates & TestCDates for comparing/sorting files or CNRITEMS by date/time.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 42.9 KB
RevLine 
[123]1
2/***********************************************************************
3
4 $Id: select.c 897 2007-12-30 23:34:00Z gyoung $
5
[362]6 Container item selection support routines
7
[123]8 Copyright (c) 1993-98 M. Kimes
[672]9 Copyright (c) 2004, 2007 Steven H. Levine
[123]10
[158]11 01 Aug 04 SHL Rework lstrip/rstrip usage
12 25 May 05 SHL Rework for ULONGLONG
[204]13 06 Jun 05 SHL Drop unused code
[317]14 06 Jul 06 SHL Support compare content (IDM_SELECTSAMECONTENT)
[362]15 13 Jul 06 SHL Use Runtime_Error
[406]16 29 Jul 06 SHL Use xfgets_bstripcr
[442]17 15 Aug 06 SHL Rework SetMask args and logic
[603]18 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits
[618]19 19 Apr 07 SHL Sync with NumItemsToUnhilite mods
[672]20 12 May 07 SHL Use dcd->ulItemsToUnHilite
[690]21 14 Jun 07 SHL SelectAll: make odd expression go away
[751]22 02 Aug 07 SHL Sync with CNRITEM mods
[762]23 04 Aug 07 SHL Use Runtime_Error
[769]24 05 Aug 07 SHL Rework SpecialSelect to use CNRITEM_EXISTS and
25 not use pszFileName since CNRITEM_EXISTS set implies
26 pszFileName not null
[787]27 14 Aug 07 SHL Revert ExpandAll DosSleep to 0
[793]28 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
[814]29 26 Aug 07 GKY DosSleep(1) in loops changed to (0)
[123]30
31***********************************************************************/
32
[2]33#define INCL_DOS
34#define INCL_WIN
[158]35#define INCL_LONGLONG
36#include <os2.h>
[2]37
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <share.h>
[317]42#include <io.h>
[158]43
[2]44#include "fm3dll.h"
45#include "fm3str.h"
46
[362]47static PSZ pszSrcFile = __FILE__;
48
[672]49VOID UnHilite(HWND hwndCnr, BOOL all, CHAR *** list, ULONG ulItemsToUnHilite)
[317]50{
[2]51 PCNRITEM pci;
[603]52 INT numfiles = 0, numalloc = 0, x = 0;
[551]53 INT attribute = CRA_CURSORED;
[2]54
[362]55 if (all && list && *list) {
[2]56 FreeList(*list);
57 *list = NULL;
58 }
[551]59 pci = (PCNRITEM) CurrentRecord(hwndCnr);
[748]60 if (pci && (INT)pci != -1) {
[362]61 if (pci->rc.flRecordAttr & CRA_SELECTED) {
[2]62 attribute = CRA_SELECTED;
[551]63 pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
64 MPFROMSHORT(attribute));
[2]65 }
[748]66 while (pci && (INT)pci != -1) {
[551]67 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
68 MPFROM2SHORT(FALSE, CRA_SELECTED));
[362]69 if (!all)
[690]70 break;
[618]71 // Count is one extra to ensure non-zero elsewhere
[672]72 // x is 0 based index
73 if (x + 2 == ulItemsToUnHilite)
[690]74 break;
[362]75 if (list)
[730]76 AddToList(pci->pszFileName, list, &numfiles, &numalloc);
[551]77 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
78 MPFROMP(pci), MPFROMSHORT(CRA_SELECTED));
[603]79 x++;
[2]80 }
81 }
82}
83
[551]84VOID SelectList(HWND hwndCnr, BOOL partial, BOOL deselect, BOOL clearfirst,
[748]85 PCNRITEM pciParent, PSZ filename, CHAR ** list)
[362]86{
[2]87
[551]88 PCNRITEM pci;
[2]89 register INT x;
[551]90 BOOL foundone = FALSE;
[766]91 ULONG errs = 0;
[2]92
[362]93 if (clearfirst && !deselect)
[672]94 UnHilite(hwndCnr, TRUE, NULL, 0);
[362]95 if (list && list[0]) {
[551]96 for (x = 0; list[x]; x++) {
[2]97 pci = FindCnrRecord(hwndCnr,
[551]98 list[x], pciParent, partial, partial, TRUE);
[362]99 if (pci) {
[551]100 WinSendMsg(hwndCnr,
101 CM_SETRECORDEMPHASIS,
102 MPFROMP(pci),
103 MPFROM2SHORT((SHORT) ((deselect) ? FALSE : TRUE),
104 CRA_SELECTED));
105 foundone = TRUE;
[2]106 }
107 }
[362]108 if (!foundone)
109 Runtime_Error(pszSrcFile, __LINE__, "select failed");
[2]110 }
[362]111 else if (filename && *filename) {
[2]112
113 FILE *fp;
[551]114 CHAR input[1024], *p;
[2]115
[551]116 fp = _fsopen(filename, "r", SH_DENYNO);
[362]117 if (fp) {
118 while (!feof(fp)) {
[551]119 if (!xfgets_bstripcr(input, sizeof(input), fp, pszSrcFile, __LINE__))
120 break;
121 if (*input == '\"') {
122 memmove(input, input + 1, strlen(input) + 1);
123 lstrip(input);
124 p = strchr(input, '\"');
125 if (p)
126 *p = 0;
127 rstrip(input);
128 }
129 else {
130 p = strchr(input, ' ');
131 if (p)
132 *p = 0;
133 }
134 /* input now contains name of file to select */
135 pci = FindCnrRecord(hwndCnr,
136 input, pciParent, partial, partial, TRUE);
137 if (pci) /* found it? */
138 WinSendMsg(hwndCnr,
139 CM_SETRECORDEMPHASIS,
140 MPFROMP(pci),
141 MPFROM2SHORT((SHORT) ((deselect) ? FALSE : TRUE),
142 CRA_SELECTED));
143 else
144 errs++;
[766]145 if (errs > 50) { /* prevent runaway on bad file */
[2]146
[551]147 APIRET ret;
[2]148
[551]149 ret = saymsg(MB_YESNO,
150 hwndCnr,
151 GetPString(IDS_POSSIBLEERRORTEXT),
152 GetPString(IDS_MAYNOTBELISTTEXT), filename);
153 if (ret == MBID_NO)
154 break;
[766]155 errs = 0;
[551]156 }
[2]157 }
158 fclose(fp);
159 }
160 }
161}
162
[748]163VOID SelectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
164 PSZ text, BOOL is_arc)
[362]165{
[2]166
[551]167 PCNRITEM pci;
168 BOOL markit;
[748]169 PSZ file;
170 PSZ pszToMatch;
[551]171 MASK Mask;
[748]172 INT x;
[551]173 ULONG textlen = 0;
[2]174
[362]175 if (text)
[2]176 textlen = strlen(text);
[551]177 memset(&Mask, 0, sizeof(Mask));
[442]178 if (maskstr)
[551]179 SetMask(maskstr, &Mask);
180 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
181 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
[748]182 while (pci && (INT)pci != -1) {
183
[2]184 markit = FALSE;
[748]185
186 if (~pci->rc.flRecordAttr & CRA_FILTERED) {
[362]187 if (!is_arc) {
[748]188 if (files && ~pci->attrFile & FILE_DIRECTORY)
[551]189 markit = TRUE;
[748]190 if (dirs && pci->attrFile & FILE_DIRECTORY)
[551]191 markit = TRUE;
[2]192 }
193 else
[551]194 markit = TRUE;
[442]195 if (maskstr && *maskstr && markit) {
[551]196 markit = FALSE;
[748]197 // Point a filename part
[730]198 file = strrchr(pci->pszFileName, '\\');
[551]199 if (!file)
[730]200 file = strrchr(pci->pszFileName, ':');
[551]201 if (file)
202 file++;
203 else
[730]204 file = pci->pszFileName;
[551]205 for (x = 0; Mask.pszMasks[x]; x++) {
206 if (*Mask.pszMasks[x]) {
[748]207 if ((strchr(Mask.pszMasks[x], '\\') ||
208 strchr(Mask.pszMasks[x], ':')))
209 pszToMatch = pci->pszFileName;
210 else
211 pszToMatch = file;
[551]212 if (*Mask.pszMasks[x] != '/') {
[748]213 if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE)) {
[551]214 markit = TRUE;
[690]215 }
[551]216 }
217 else {
[748]218 if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
[551]219 markit = FALSE;
220 break;
221 }
222 }
223 }
[690]224 } // for
[2]225 }
226 }
227
[748]228 if (markit && text && *text) {
229 if (~pci->attrFile & FILE_DIRECTORY) {
230 PSZ input;
231 markit = FALSE;
232 input = xmalloc(65537, pszSrcFile, __LINE__);
233 if (input) {
234 ULONG pos;
235 LONG len;
236 FILE *inputFile;
[2]237
[748]238 if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
239 pos = ftell(inputFile);
240 while (!feof(inputFile)) {
241 if (pos)
242 fseek(inputFile, pos - 256, SEEK_SET);
243 len = fread(input, 1, 65536, inputFile);
244 if (len >= 0) {
245 if (findstring(text, textlen, input, len, FALSE)) {
246 markit = TRUE;
247 break;
248 }
249 }
250 else
[551]251 break;
[787]252 } // while
[748]253 fclose(inputFile);
[551]254 }
[748]255 free(input);
[766]256 DosSleep(1);
[551]257 }
[2]258 }
[748]259 else
260 markit = FALSE;
[2]261 }
[748]262
[362]263 if (markit)
[551]264 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
265 MPFROM2SHORT(TRUE, CRA_SELECTED));
266 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
267 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
268 } // while
[2]269}
270
[748]271VOID DeselectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
272 PSZ text, BOOL is_arc)
[362]273{
[551]274 PCNRITEM pci;
275 BOOL unmarkit;
[748]276 PSZ file;
277 PSZ pszToMatch;
[551]278 MASK Mask;
279 register INT x;
280 ULONG textlen = 0;
[2]281
[362]282 if (text)
[2]283 textlen = strlen(text);
[551]284 memset(&Mask, 0, sizeof(Mask));
[442]285 if (maskstr && *maskstr)
[551]286 SetMask(maskstr, &Mask);
287 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
288 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
[748]289 while (pci && (INT)pci != -1) {
[2]290 unmarkit = FALSE;
[748]291 if (~pci->rc.flRecordAttr & CRA_FILTERED) {
[362]292 if (!is_arc) {
[748]293 if (files && ~pci->attrFile & FILE_DIRECTORY)
[551]294 unmarkit = TRUE;
295 if (dirs && (pci->attrFile & FILE_DIRECTORY))
296 unmarkit = TRUE;
[2]297 }
298 else
[551]299 unmarkit = TRUE;
[442]300 if (maskstr && *maskstr && unmarkit) {
[551]301 unmarkit = FALSE;
[730]302 file = strrchr(pci->pszFileName, '\\');
[551]303 if (!file)
[730]304 file = strrchr(pci->pszFileName, ':');
[551]305 if (file)
306 file++;
307 else
[730]308 file = pci->pszFileName;
[551]309 for (x = 0; Mask.pszMasks[x]; x++) {
310 if (*Mask.pszMasks[x]) {
[748]311 if (strchr(Mask.pszMasks[x], '\\') ||
312 strchr(Mask.pszMasks[x], ':'))
313 pszToMatch = pci->pszFileName;
314 else
315 pszToMatch = file;
[551]316 if (*Mask.pszMasks[x] != '/') {
[748]317 if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE))
[551]318 unmarkit = TRUE;
319 }
320 else {
[748]321 if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
[551]322 unmarkit = FALSE;
323 break;
324 }
325 }
326 }
327 }
[2]328 }
329 }
330
[748]331 if (unmarkit && text && *text) {
332 if (~pci->attrFile & FILE_DIRECTORY) {
333 PSZ input;
334 unmarkit = FALSE;
335 input = xmalloc(65537, pszSrcFile, __LINE__);
336 if (input) {
337 ULONG pos;
338 LONG len;
339 FILE *inputFile;
[2]340
[748]341 if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
342 pos = ftell(inputFile);
343 while (!feof(inputFile)) {
344 if (pos)
345 fseek(inputFile, pos - 256, SEEK_SET);
346 len = fread(input, 1, 65536, inputFile);
347 if (len >= 0) {
348 if (findstring(text, textlen, input, len, FALSE)) {
349 unmarkit = TRUE;
350 break;
351 }
352 }
353 else
[551]354 break;
[787]355 } // while
[748]356 fclose(inputFile);
[551]357 }
[748]358 free(input);
[766]359 DosSleep(1);
[551]360 }
[2]361 }
[748]362 else
363 unmarkit = FALSE;
[2]364 }
[748]365
[362]366 if (unmarkit)
[551]367 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, pci,
368 MPFROM2SHORT(FALSE, CRA_SELECTED | CRA_CURSORED |
369 CRA_INUSE | CRA_SOURCE));
370 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
371 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
[2]372 }
373}
374
[551]375VOID Deselect(HWND hwndCnr)
[317]376{
[2]377 PCNRITEM pcil;
378
[551]379 pcil = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
380 MPFROMLONG(CMA_FIRST),
381 MPFROMSHORT(CRA_SELECTED));
[748]382 while (pcil && (INT)pcil != -1) {
[551]383 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pcil),
384 MPFROM2SHORT(FALSE, CRA_SELECTED));
385 pcil = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pcil),
386 MPFROMSHORT(CRA_SELECTED));
[2]387 }
388}
389
[317]390//=== HideAll() Hide all selected records ===
[2]391
[551]392VOID HideAll(HWND hwndCnr)
[317]393{
[551]394 PCNRITEM pci, pciH;
395 INT attribute = CRA_CURSORED;
396 CNRINFO cnri;
397 BOOL didone = FALSE;
[2]398
[551]399 memset(&cnri, 0, sizeof(CNRINFO));
[2]400 cnri.cb = sizeof(CNRINFO);
[551]401 WinSendMsg(hwndCnr, CM_QUERYCNRINFO, MPFROMP(&cnri),
402 MPFROMLONG(sizeof(CNRINFO)));
403 pci = (PCNRITEM) CurrentRecord(hwndCnr);
[748]404 if (pci && (INT)pci != -1) {
[362]405 if (pci->rc.flRecordAttr & CRA_SELECTED) {
[2]406 attribute = CRA_SELECTED;
[551]407 pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
408 MPFROMSHORT(attribute));
[2]409 }
410 }
[748]411 while (pci && (INT)pci != -1) {
[551]412 pciH = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
413 MPFROMSHORT(attribute));
414 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
415 MPFROM2SHORT(FALSE, CRA_CURSORED | CRA_SELECTED |
416 CRA_INUSE | CRA_SOURCE));
[2]417 pci->rc.flRecordAttr |= CRA_FILTERED;
418 didone = TRUE;
[362]419 if (fSyncUpdates) {
420 if (cnri.flWindowAttr & CV_DETAIL)
[551]421 WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
422 MPFROM2SHORT(0, CMA_REPOSITION | CMA_ERASE));
[2]423 else
[551]424 WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPFROMP(&pci),
425 MPFROM2SHORT(1, CMA_REPOSITION | CMA_ERASE));
[2]426 }
427 pci = pciH;
428 }
[362]429 if (didone && !fSyncUpdates)
[551]430 WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
431 MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION));
[2]432}
433
[551]434VOID MarkAll(HWND hwndCnr, BOOL quitit, BOOL target, BOOL source)
[317]435{
[2]436 PCNRITEM pci;
[551]437 INT attribute = CRA_CURSORED;
[2]438
[362]439 if (quitit)
[618]440 attribute = target ? CRA_TARGET : source ? CRA_SOURCE : CRA_INUSE;
[551]441 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
442 MPFROMLONG(CMA_FIRST), MPFROMSHORT(attribute));
[748]443 if (pci && (INT)pci != -1) {
[362]444 if (attribute == CRA_CURSORED) {
445 if (pci->rc.flRecordAttr & CRA_SELECTED) {
[551]446 attribute = CRA_SELECTED;
447 pci =
448 WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
449 MPFROMSHORT(attribute));
[2]450 }
451 }
452 }
[748]453 while (pci && (INT)pci != -1) {
[551]454 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
455 MPFROM2SHORT(!quitit,
[618]456 target ? CRA_TARGET : source ? CRA_SOURCE :
457 CRA_INUSE));
[551]458 pci =
459 WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
460 MPFROMSHORT(attribute));
[2]461 }
462}
463
[551]464VOID RemoveAll(HWND hwndCnr, ULONGLONG * pullTotalBytes,
465 ULONG * pulTotalFiles)
[317]466{
[2]467 PCNRITEM pci;
[551]468 INT attribute = CRA_CURSORED;
469 BOOL didone = FALSE;
[2]470
[551]471 pci = (PCNRITEM) CurrentRecord(hwndCnr);
[748]472 if (pci && (INT)pci != -1) {
[362]473 if (pci->rc.flRecordAttr & CRA_SELECTED) {
[2]474 attribute = CRA_SELECTED;
[551]475 pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
476 MPFROMSHORT(attribute));
[2]477 }
478 }
[748]479 while (pci && (INT)pci != -1) {
480 if (~pci->rc.flRecordAttr & CRA_FILTERED) {
[2]481 didone = TRUE;
[158]482 if (pulTotalFiles)
[689]483 *pulTotalFiles -= 1;
[158]484 if (pullTotalBytes)
[551]485 *pullTotalBytes -= (pci->cbFile + pci->easize);
486 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
487 MPFROM2SHORT(0, CRA_SELECTED));
[362]488 if (fSyncUpdates)
[751]489 RemoveCnrItems(hwndCnr, pci, 1, CMA_FREE | CMA_INVALIDATE);
[2]490 else
[751]491 RemoveCnrItems(hwndCnr, pci, 1, CMA_FREE);
[362]492 if (attribute == CRA_CURSORED)
[551]493 break;
494 pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
495 MPFROMSHORT(attribute));
[2]496 }
497 else
[551]498 pci = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
499 MPFROMSHORT(attribute));
[2]500 }
[362]501 if (didone && !fSyncUpdates)
[551]502 WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPVOID,
503 MPFROM2SHORT(0, CMA_REPOSITION));
[2]504}
505
[442]506//== SetMask() Convert mask string to array of pointers to masks ==
507
[551]508VOID SetMask(PSZ maskstr, MASK * mask)
[317]509{
[442]510 UINT x;
511 PSZ p;
[2]512
[442]513 if (maskstr)
[551]514 strcpy(mask->szMask, maskstr); // Got new mask string
[442]515 // Build array of pointers
516 p = mask->szMaskCopy;
[551]517 strcpy(p, mask->szMask);
[442]518 // Allow up to 25 masks - ignore extras
519 for (x = 0; *p && x < 25; x++) {
520 mask->pszMasks[x] = p;
[362]521 while (*p && *p != ';')
[442]522 p++; // Find separator
[362]523 if (*p) {
[442]524 *p = 0; // Replace ;
[2]525 p++;
526 }
[551]527 } // for
[442]528 mask->pszMasks[x] = NULL; // Mark end
[2]529}
530
[551]531VOID ExpandAll(HWND hwndCnr, BOOL expand, PCNRITEM pciParent)
[317]532{
[2]533 PCNRITEM pci;
534
[362]535 if (!pciParent)
[551]536 pciParent = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL),
537 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
[362]538 if (pciParent) {
[748]539 if (expand && ~pciParent->rc.flRecordAttr & CRA_EXPANDED)
[551]540 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciParent), MPVOID);
[362]541 else if (!expand && (pciParent->rc.flRecordAttr & CRA_EXPANDED))
[551]542 WinSendMsg(hwndCnr, CM_COLLAPSETREE, MPFROMP(pciParent), MPVOID);
543 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pciParent),
544 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
[362]545 if (pci)
[787]546 DosSleep(0);
[748]547 while (pci && (INT)pci != -1) {
[551]548 ExpandAll(hwndCnr, expand, pci);
549 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
550 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
[2]551 }
552 }
[787]553 DosSleep(0);
[2]554}
555
[551]556VOID InvertAll(HWND hwndCnr)
[317]557{
[2]558 PCNRITEM pci;
559
[551]560 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
561 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
[748]562 while (pci && (INT)pci != -1) {
563 if (~pci->rc.flRecordAttr & CRA_FILTERED) {
564 if (~pci->rc.flRecordAttr & CRA_SELECTED)
[551]565 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
566 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]567 else
[551]568 WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
569 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]570 }
[551]571 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
572 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
[2]573 }
574}
575
[762]576/**
577 * Do select actions for compare directories containers
578 *
579 */
580
[551]581VOID SpecialSelect(HWND hwndCnrS, HWND hwndCnrD, INT action, BOOL reset)
[317]582{
[551]583 PCNRITEM pciS, pciD, *pciSa = NULL, *pciDa = NULL;
584 CNRINFO cnri;
585 BOOL slow = FALSE;
[769]586 UINT x, numD, numS;
[897]587 INT ret = 0;
[2]588
[762]589 if (!hwndCnrS || !hwndCnrD) {
590 Runtime_Error(pszSrcFile, __LINE__, "hwndCnrS %p hwndCnrD %p", hwndCnrS, hwndCnrD);
[2]591 return;
[762]592 }
[2]593
[551]594 memset(&cnri, 0, sizeof(CNRINFO));
[2]595 cnri.cb = sizeof(CNRINFO);
[551]596 WinSendMsg(hwndCnrD, CM_QUERYCNRINFO, MPFROMP(&cnri),
597 MPFROMLONG(sizeof(CNRINFO)));
[769]598 numD = cnri.cRecords;
[551]599 memset(&cnri, 0, sizeof(CNRINFO));
[2]600 cnri.cb = sizeof(CNRINFO);
[551]601 WinSendMsg(hwndCnrS, CM_QUERYCNRINFO, MPFROMP(&cnri),
602 MPFROMLONG(sizeof(CNRINFO)));
[769]603 numS = cnri.cRecords;
[362]604 if (!numD || numS != numD) {
[762]605 Runtime_Error(pszSrcFile, __LINE__, "numD %u != numS %u", numD, numS);
[2]606 return;
607 }
[551]608 pciDa = xmalloc(sizeof(PCNRITEM) * numD, pszSrcFile, __LINE__);
[362]609 if (!pciDa)
[2]610 return;
611
[551]612 pciSa = xmalloc(sizeof(PCNRITEM) * numS, pszSrcFile, __LINE__);
[362]613 if (!pciSa) {
614 free(pciDa);
[2]615 return;
616 }
617
618Restart:
619
[551]620 memset(pciDa, 0, sizeof(PCNRITEM) * numD);
621 memset(pciSa, 0, sizeof(PCNRITEM) * numS);
[2]622
[769]623 pciD = (PCNRITEM)WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPVOID,
[551]624 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
[2]625 x = 0;
[748]626 while (pciD && (INT)pciD != -1 && x < numD) {
[362]627 if (reset)
[2]628 pciD->flags = 0;
629 pciDa[x] = pciD;
630 x++;
[362]631 if (!slow)
[551]632 pciD = (PCNRITEM) pciD->rc.preccNextRecord;
[2]633 else
[551]634 pciD = (PCNRITEM) WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPFROMP(pciD),
635 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
[362]636 if (!(x % 500))
[814]637 DosSleep(0); //26 Aug 07 GKY 1
[769]638 // else if (!(x % 50))
[787]639 // DosSleep(0);
[762]640 } // while
641
[362]642 if (numD != x) {
643 if (!slow) {
[2]644 slow = TRUE;
645 goto Restart;
646 }
647 free(pciDa);
648 free(pciSa);
[762]649 Runtime_Error(pszSrcFile, __LINE__, "numD %u != x %lu", numD, x);
[2]650 return;
651 }
652
[551]653 pciS = (PCNRITEM) WinSendMsg(hwndCnrS, CM_QUERYRECORD, MPVOID,
654 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
[2]655 x = 0;
[748]656 while (pciS && (INT)pciS != -1 && x < numS) {
[362]657 if (reset)
[2]658 pciS->flags = 0;
659 pciSa[x] = pciS;
660 x++;
[362]661 if (!slow)
[551]662 pciS = (PCNRITEM) pciS->rc.preccNextRecord;
[2]663 else
[551]664 pciS = (PCNRITEM) WinSendMsg(hwndCnrS, CM_QUERYRECORD, MPFROMP(pciS),
665 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
[362]666 if (!(x % 500))
[814]667 DosSleep(0); //26 Aug 07 GKY 1
[769]668 // else if (!(x % 50))
[787]669 // DosSleep(0);
[762]670 } // while
671
[362]672 if (numS != x) {
673 if (!slow) {
[2]674 slow = TRUE;
675 goto Restart;
676 }
677 free(pciSa);
678 free(pciDa);
[551]679 Runtime_Error(pszSrcFile, __LINE__, "numS (%lu) != x (%lu)", numS, x);
[2]680 return;
681 }
682
[769]683 // 05 Aug 07 SHL fixme to know what sets reset
[362]684 if (reset) {
[769]685 // Update flags for files that exist on both sides
[551]686 for (x = 0; x < numS; x++) {
[748]687
[769]688 // 05 Aug 07 SHL fixme to know if should clear first
[730]689 if (!*pciSa[x]->pszFileName || !*pciDa[x]->pszFileName)
[551]690 continue;
[748]691
[769]692 pciSa[x]->flags |= CNRITEM_EXISTS; // File exists on both sides
[2]693 pciDa[x]->flags |= CNRITEM_EXISTS;
[362]694 if (pciSa[x]->cbFile + pciSa[x]->easize >
[551]695 pciDa[x]->cbFile + pciDa[x]->easize) {
696 pciSa[x]->flags |= CNRITEM_LARGER;
697 pciDa[x]->flags |= CNRITEM_SMALLER;
[2]698 }
[362]699 else if (pciSa[x]->cbFile + pciSa[x]->easize <
[551]700 pciDa[x]->cbFile + pciDa[x]->easize) {
701 pciSa[x]->flags |= CNRITEM_SMALLER;
702 pciDa[x]->flags |= CNRITEM_LARGER;
[2]703 }
[897]704 ret = TestCDates(&pciDa[x]->date, &pciDa[x]->time,
705 &pciSa[x]->date, &pciSa[x]->time);
706 if (ret == 1)
707 /*((pciSa[x]->date.year > pciDa[x]->date.year) ? TRUE :
[551]708 (pciSa[x]->date.year < pciDa[x]->date.year) ? FALSE :
709 (pciSa[x]->date.month > pciDa[x]->date.month) ? TRUE :
710 (pciSa[x]->date.month < pciDa[x]->date.month) ? FALSE :
711 (pciSa[x]->date.day > pciDa[x]->date.day) ? TRUE :
712 (pciSa[x]->date.day < pciDa[x]->date.day) ? FALSE :
713 (pciSa[x]->time.hours > pciDa[x]->time.hours) ? TRUE :
714 (pciSa[x]->time.hours < pciDa[x]->time.hours) ? FALSE :
715 (pciSa[x]->time.minutes > pciDa[x]->time.minutes) ? TRUE :
716 (pciSa[x]->time.minutes < pciDa[x]->time.minutes) ? FALSE :
717 (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? TRUE :
[897]718 (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? FALSE : FALSE)*/ {
[551]719 pciSa[x]->flags |= CNRITEM_NEWER;
720 pciDa[x]->flags |= CNRITEM_OLDER;
[2]721 }
[897]722 else if (ret == -1)
723 /*((pciSa[x]->date.year < pciDa[x]->date.year) ? TRUE :
[551]724 (pciSa[x]->date.year > pciDa[x]->date.year) ? FALSE :
725 (pciSa[x]->date.month < pciDa[x]->date.month) ? TRUE :
726 (pciSa[x]->date.month > pciDa[x]->date.month) ? FALSE :
727 (pciSa[x]->date.day < pciDa[x]->date.day) ? TRUE :
728 (pciSa[x]->date.day > pciDa[x]->date.day) ? FALSE :
729 (pciSa[x]->time.hours < pciDa[x]->time.hours) ? TRUE :
730 (pciSa[x]->time.hours > pciDa[x]->time.hours) ? FALSE :
731 (pciSa[x]->time.minutes < pciDa[x]->time.minutes) ? TRUE :
732 (pciSa[x]->time.minutes > pciDa[x]->time.minutes) ? FALSE :
733 (pciSa[x]->time.seconds < pciDa[x]->time.seconds) ? TRUE :
734 (pciSa[x]->time.seconds > pciDa[x]->time.seconds) ? FALSE :
[897]735 FALSE)*/ {
[551]736 pciSa[x]->flags |= CNRITEM_OLDER;
737 pciDa[x]->flags |= CNRITEM_NEWER;
[2]738 }
[362]739 if (!(x % 500))
[814]740 DosSleep(0); //26 Aug 07 GKY 1
[769]741 // else if (!(x % 50))
[787]742 // DosSleep(0);
[769]743 } // for
744 } // if reset
[2]745
[551]746 switch (action) {
747 case IDM_SELECTIDENTICAL:
748 for (x = 0; x < numS; x++) {
[769]749 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
750 pciSa[x]->flags & CNRITEM_EXISTS &&
751 ~pciSa[x]->flags & CNRITEM_SMALLER &&
752 ~pciSa[x]->flags & CNRITEM_LARGER &&
753 ~pciSa[x]->flags & CNRITEM_NEWER &&
754 ~pciSa[x]->flags & CNRITEM_OLDER) {
755 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
756 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
757 MPFROM2SHORT(TRUE, CRA_SELECTED));
758 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
759 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
760 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]761 }
[769]762 if (!(x % 500))
[814]763 DosSleep(0); //26 Aug 07 GKY 1
[769]764 // else if (!(x % 50))
[787]765 // DosSleep(0);
[769]766 } // for
[551]767 break;
[2]768
[551]769 case IDM_SELECTSAME:
770 for (x = 0; x < numS; x++) {
[748]771 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
772 pciSa[x]->flags & CNRITEM_EXISTS &&
773 ~pciSa[x]->flags & CNRITEM_SMALLER &&
774 ~pciSa[x]->flags & CNRITEM_LARGER) {
775 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
[551]776 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
777 MPFROM2SHORT(TRUE, CRA_SELECTED));
[748]778 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
[551]779 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
780 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]781 }
[551]782 if (!(x % 500))
[814]783 DosSleep(0); //26 Aug 07 GKY 1
[769]784 // else if (!(x % 50))
[787]785 // DosSleep(0);
[551]786 }
787 break;
[2]788
[551]789 case IDM_SELECTSAMECONTENT:
790 for (x = 0; x < numS; x++) {
791 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
[769]792 pciSa[x]->flags & CNRITEM_EXISTS)
[748]793 {
[551]794 FILE *fp1 = NULL;
795 FILE *fp2 = NULL;
796 BOOL gotMatch = FALSE;
797 UINT errLineNo = 0;
798 UINT compErrno = 0;
799 CHAR buf1[1024];
800 CHAR buf2[1024];
801 HAB hab = WinQueryAnchorBlock(hwndCnrS);
[317]802
[769]803 if (!*pciSa[x]->pszFileName ||
804 !*pciDa[x]->pszFileName) {
805 Runtime_Error(pszSrcFile, __LINE__,
806 "CNRITEM_EXISTS set with null file name for index %u", x);
807 break;
808 }
809
[730]810 fp1 = _fsopen(pciSa[x]->pszFileName, "rb", SH_DENYNO);
[551]811 if (!fp1) {
812 errLineNo = __LINE__;
813 compErrno = errno;
814 }
815 else {
[730]816 fp2 = _fsopen(pciDa[x]->pszFileName, "rb", SH_DENYNO);
[551]817 if (!fp2) {
[362]818 errLineNo = __LINE__;
819 compErrno = errno;
[317]820 }
821 else {
[847]822 size_t len1 = filelength(fileno(fp1));
823 size_t len2 = filelength(fileno(fp2));
[551]824
825 if (len1 == len2) {
826 setbuf(fp1, NULL);
827 setbuf(fp2, NULL);
828 while (WinIsWindow(hab, hwndCnrS)) {
829 size_t numread1 = fread(buf1, 1, 1024, fp1);
830 size_t numread2 = fread(buf2, 1, 1024, fp2);
831
832 if (!numread1 || !numread2 || numread1 != numread2) {
833 if (ferror(fp1) || ferror(fp2)) {
834 errLineNo = __LINE__;
835 compErrno = errno;
[317]836 }
[551]837 else if (feof(fp1) && feof(fp2))
838 gotMatch = TRUE;
839 break;
840 }
841 else if (memcmp(buf1, buf2, numread1))
842 break;
[690]843 } // while
844 } // same len
[551]845 }
846 }
[317]847
[551]848 if (fp1)
849 fclose(fp1);
[317]850
[551]851 if (fp2)
852 fclose(fp2);
[317]853
[551]854 if (errLineNo) {
855 Runtime_Error(pszSrcFile, errLineNo,
856 "error %d while comparing", compErrno);
857 }
[769]858
[551]859 if (gotMatch) {
[748]860 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
[551]861 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
862 MPFROM2SHORT(TRUE, CRA_SELECTED));
[748]863 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
[551]864 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
865 MPFROM2SHORT(TRUE, CRA_SELECTED));
866 }
867 }
868 if (!(x % 500))
[814]869 DosSleep(0); //26 Aug 07 GKY 1
[769]870 // else if (!(x % 50))
[787]871 // DosSleep(0);
[769]872 } // for
[551]873 break;
[317]874
[551]875 case IDM_SELECTBOTH:
876 for (x = 0; x < numS; x++) {
[748]877 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
878 pciSa[x]->flags & CNRITEM_EXISTS) {
879 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
[551]880 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
881 MPFROM2SHORT(TRUE, CRA_SELECTED));
[748]882 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
[551]883 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
884 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]885 }
[551]886 if (!(x % 500))
[814]887 DosSleep(0); //26 Aug 07 GKY 1
[769]888 // else if (!(x % 50))
[787]889 // DosSleep(0);
[551]890 }
891 break;
[2]892
[551]893 case IDM_SELECTONE:
894 for (x = 0; x < numS; x++) {
[748]895 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
[769]896 ~pciSa[x]->flags & CNRITEM_EXISTS) {
897 if (*pciSa[x]->pszFileName) {
898 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED) {
899 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
900 MPFROM2SHORT(TRUE, CRA_SELECTED));
901 }
902 }
903 else if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED) {
[551]904 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
905 MPFROM2SHORT(TRUE, CRA_SELECTED));
[769]906 }
[551]907 }
908 if (!(x % 500))
[814]909 DosSleep(0); //26 Aug 07 GKY 1
[769]910 // else if (!(x % 50))
[787]911 // DosSleep(0);
[551]912 }
913 break;
[2]914
[551]915 case IDM_SELECTBIGGER:
916 for (x = 0; x < numS; x++) {
[769]917 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
918 if (pciSa[x]->flags & CNRITEM_LARGER) {
919 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
920 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
921 MPFROM2SHORT(TRUE, CRA_SELECTED));
922 }
923 else if (pciDa[x]->flags & CNRITEM_LARGER) {
924 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
925 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
926 MPFROM2SHORT(TRUE, CRA_SELECTED));
927 }
[2]928 }
[551]929 if (!(x % 500))
[814]930 DosSleep(0); //26 Aug 07 GKY 1
[769]931 // else if (!(x % 50))
[787]932 // DosSleep(0);
[551]933 }
934 break;
[2]935
[551]936 case IDM_SELECTSMALLER:
937 for (x = 0; x < numS; x++) {
[769]938 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
939 if (pciSa[x]->flags & CNRITEM_SMALLER) {
940 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
941 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
942 MPFROM2SHORT(TRUE, CRA_SELECTED));
943 }
944 else if (pciDa[x]->flags & CNRITEM_SMALLER) {
945 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
946 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
947 MPFROM2SHORT(TRUE, CRA_SELECTED));
948 }
[2]949 }
[551]950 if (!(x % 500))
[814]951 DosSleep(0); //26 Aug 07 GKY 1
[769]952 // else if (!(x % 50))
[787]953 // DosSleep(0);
[551]954 }
955 break;
[2]956
[551]957 case IDM_SELECTNEWER:
958 for (x = 0; x < numS; x++) {
[769]959 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
960 if (pciSa[x]->flags & CNRITEM_NEWER) {
961 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
962 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
963 MPFROM2SHORT(TRUE, CRA_SELECTED));
964 }
965 else if (pciDa[x]->flags & CNRITEM_NEWER) {
966 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
967 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
968 MPFROM2SHORT(TRUE, CRA_SELECTED));
969 }
[2]970 }
[551]971 if (!(x % 500))
[814]972 DosSleep(0); //26 Aug 07 GKY 1
[769]973 // else if (!(x % 50))
[787]974 // DosSleep(0);
[551]975 }
976 break;
[2]977
[551]978 case IDM_SELECTOLDER:
979 for (x = 0; x < numS; x++) {
[769]980 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
981 if (pciSa[x]->flags & CNRITEM_OLDER) {
982 if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
983 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
984 MPFROM2SHORT(TRUE, CRA_SELECTED));
985 }
986 else if (pciDa[x]->flags & CNRITEM_OLDER) {
987 if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
988 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
989 MPFROM2SHORT(TRUE, CRA_SELECTED));
990 }
[2]991 }
[551]992 if (!(x % 500))
[814]993 DosSleep(0); //26 Aug 07 GKY 1
[769]994 // else if (!(x % 50))
[787]995 // DosSleep(0);
[551]996 }
997 break;
[2]998
[551]999 case IDM_DESELECTBOTH:
1000 for (x = 0; x < numS; x++) {
[748]1001 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
1002 pciSa[x]->flags & CNRITEM_EXISTS) {
[551]1003 if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
1004 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
1005 MPFROM2SHORT(FALSE, CRA_SELECTED));
1006 if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
1007 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
1008 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1009 }
[551]1010 if (!(x % 500))
[814]1011 DosSleep(0); //26 Aug 07 GKY 1
[769]1012 // else if (!(x % 50))
[787]1013 // DosSleep(0);
[551]1014 }
1015 break;
[2]1016
[551]1017 case IDM_DESELECTONE:
1018 for (x = 0; x < numS; x++) {
[769]1019 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
1020 if (~pciSa[x]->flags & CNRITEM_EXISTS) {
1021 if (*pciSa[x]->pszFileName) {
1022 if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
1023 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
1024 MPFROM2SHORT(FALSE, CRA_SELECTED));
1025 }
1026 else if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
1027 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
1028 MPFROM2SHORT(FALSE, CRA_SELECTED));
1029 }
[2]1030 }
[551]1031 if (!(x % 500))
[814]1032 DosSleep(0); //26 Aug 07 GKY 1
[769]1033 // else if (!(x % 50))
[787]1034 // DosSleep(0);
[551]1035 }
1036 break;
[2]1037
[551]1038 case IDM_DESELECTBIGGER:
1039 for (x = 0; x < numS; x++) {
[769]1040 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
1041 if (pciSa[x]->flags & CNRITEM_LARGER) {
1042 if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
1043 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
1044 MPFROM2SHORT(FALSE, CRA_SELECTED));
1045 }
1046 else if (pciDa[x]->flags & CNRITEM_LARGER) {
1047 if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
1048 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
1049 MPFROM2SHORT(FALSE, CRA_SELECTED));
1050 }
[2]1051 }
[551]1052 if (!(x % 500))
[814]1053 DosSleep(0); //26 Aug 07 GKY 1
[769]1054 // else if (!(x % 50))
[787]1055 // DosSleep(0);
[551]1056 }
1057 break;
[2]1058
[551]1059 case IDM_DESELECTSMALLER:
1060 for (x = 0; x < numS; x++) {
[769]1061 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
1062 if (pciSa[x]->flags & CNRITEM_SMALLER) {
1063 if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
1064 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
1065 MPFROM2SHORT(FALSE, CRA_SELECTED));
1066 }
1067 else if (pciDa[x]->flags & CNRITEM_SMALLER) {
1068 if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
1069 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
1070 MPFROM2SHORT(FALSE, CRA_SELECTED));
1071 }
[2]1072 }
[551]1073 if (!(x % 500))
[814]1074 DosSleep(0); //26 Aug 07 GKY 1
[769]1075 // else if (!(x % 50))
[787]1076 // DosSleep(0);
[551]1077 }
1078 break;
[2]1079
[551]1080 case IDM_DESELECTNEWER:
1081 for (x = 0; x < numS; x++) {
[769]1082 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
1083 if (pciSa[x]->flags & CNRITEM_NEWER) {
1084 if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
1085 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
1086 MPFROM2SHORT(FALSE, CRA_SELECTED));
1087 }
1088 else if (pciDa[x]->flags & CNRITEM_NEWER) {
1089 if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
1090 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
1091 MPFROM2SHORT(FALSE, CRA_SELECTED));
1092 }
[2]1093 }
[551]1094 if (!(x % 500))
[814]1095 DosSleep(0); //26 Aug 07 GKY 1
[769]1096 // else if (!(x % 50))
[787]1097 // DosSleep(0);
[551]1098 }
1099 break;
[2]1100
[551]1101 case IDM_DESELECTOLDER:
1102 for (x = 0; x < numS; x++) {
[769]1103 if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
1104 if (pciSa[x]->flags & CNRITEM_OLDER) {
1105 if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
1106 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
1107 MPFROM2SHORT(FALSE, CRA_SELECTED));
1108 }
1109 else if (pciDa[x]->flags & CNRITEM_OLDER) {
1110 if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
1111 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
1112 MPFROM2SHORT(FALSE, CRA_SELECTED));
1113 }
[2]1114 }
[551]1115 if (!(x % 500))
[814]1116 DosSleep(0); //26 Aug 07 GKY 1
[769]1117 // else if (!(x % 50))
[787]1118 // DosSleep(0);
[551]1119 }
1120 break;
[2]1121
[551]1122 default:
1123 break;
[2]1124 }
1125
[362]1126 if (reset) {
1127 while (numS) {
[551]1128 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD,
1129 MPFROMP(pciSa), MPFROM2SHORT((min(numS, 65535)), 0));
[814]1130 DosSleep(0); //26 Aug 07 GKY 1
[551]1131 WinSendMsg(hwndCnrD, CM_INVALIDATERECORD,
1132 MPFROMP(pciDa), MPFROM2SHORT((min(numD, 65535)), 0));
1133 numS -= min(numS, 65535);
[362]1134 if (numS)
[814]1135 DosSleep(0); //26 Aug 07 GKY 1
[2]1136 }
1137 }
1138
1139 free(pciSa);
1140 free(pciDa);
1141 DosPostEventSem(CompactSem);
1142}
1143
[551]1144struct SS
1145{
1146 PCNRITEM pci;
1147 BOOL unique, all, smallest, largest, newest, oldest;
[2]1148};
1149
[551]1150struct Cnr
1151{
1152 HWND hwndCnr;
1153 ULONG numfiles;
[2]1154 struct SS *ss;
1155};
1156
[551]1157static int CompSSNamesB(const void *s1, const void *s2)
[317]1158{
[2]1159 struct SS *ss2 = (struct SS *)s2;
1160
[748]1161 return stricmp((PSZ)s1, ss2->pci->pszFileName);
[2]1162}
1163
[551]1164static int CompSSNames(const void *s1, const void *s2)
[317]1165{
[2]1166 struct SS *ss1 = (struct SS *)s1;
1167 struct SS *ss2 = (struct SS *)s2;
1168
[551]1169 return stricmp(ss1->pci->pszFileName, ss2->pci->pszFileName);
[2]1170}
1171
[551]1172VOID FreeCnrs(struct Cnr * Cnrs, INT numw)
[317]1173{
[2]1174 register INT z;
1175
[551]1176 for (z = 0; z < numw; z++) {
[362]1177 if (Cnrs[z].ss)
[2]1178 free(Cnrs[z].ss);
1179 }
1180 free(Cnrs);
1181 DosPostEventSem(CompactSem);
1182}
1183
[762]1184/**
1185 * Do select actions for single container
1186 *
1187 */
1188
[551]1189VOID SpecialSelect2(HWND hwndParent, INT action)
[317]1190{
[551]1191 PCNRITEM pci;
1192 HENUM henum;
1193 HWND hwnd;
[897]1194 INT numwindows = 0, w, x, z, cmp = 0;
[551]1195 struct Cnr *Cnrs = NULL;
1196 struct SS *bsres;
[2]1197
[362]1198 if (!hwndParent)
[2]1199 return;
1200
1201 /* count directory containers, build array of hwnds */
1202 henum = WinBeginEnumWindows(hwndParent);
[362]1203 while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE) {
[551]1204 if (WinWindowFromID(WinWindowFromID(hwnd, FID_CLIENT), DIR_CNR)) {
1205 Cnrs =
1206 xrealloc(Cnrs, (numwindows + 1) * sizeof(struct Cnr), pszSrcFile,
1207 __LINE__);
[362]1208 if (!Cnrs) {
[551]1209 Notify(GetPString(IDS_OUTOFMEMORY));
1210 return;
[2]1211 }
[551]1212 memset(&Cnrs[numwindows], 0, sizeof(struct Cnr));
[2]1213 Cnrs[numwindows].hwndCnr = WinWindowFromID(WinWindowFromID(hwnd,
[551]1214 FID_CLIENT),
1215 DIR_CNR);
[2]1216 numwindows++;
1217 }
1218 }
1219 WinEndEnumWindows(henum);
[362]1220 if (numwindows < 2) {
[551]1221 FreeCnrs(Cnrs, numwindows);
[362]1222 Runtime_Error(pszSrcFile, __LINE__, "expected two windows");
[2]1223 Notify(GetPString(IDS_COMPSEL2ORMORETEXT));
1224 return;
1225 }
[362]1226 if (numwindows > 4) {
[2]1227 WinSendMsg(Cnrs[0].
[551]1228 hwndCnr,
1229 UM_NOTIFY, MPFROMP(GetPString(IDS_BUILDINGLISTSTEXT)), MPVOID);
[814]1230 DosSleep(0); //26 Aug 07 GKY 1
[2]1231 }
1232
1233 /* count records, build array of pointers to records */
[551]1234 for (z = 0; z < numwindows; z++) {
1235 pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
1236 CM_QUERYRECORD,
1237 MPVOID,
1238 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
[2]1239 x = 0;
[748]1240 while (pci && (INT)pci != -1) {
1241 if (~pci->rc.flRecordAttr & CRA_FILTERED &&
1242 ~pci->attrFile & FILE_DIRECTORY) {
[551]1243 Cnrs[z].ss =
1244 xrealloc(Cnrs[z].ss, (x + 1) * sizeof(struct SS), pszSrcFile,
1245 __LINE__);
1246 if (!Cnrs[z].ss) {
1247 FreeCnrs(Cnrs, numwindows);
1248 Notify(GetPString(IDS_OUTOFMEMORY));
1249 return;
1250 }
1251 memset(&Cnrs[z].ss[x], 0, sizeof(struct SS));
1252 Cnrs[z].ss[x].pci = pci;
1253 x++;
[2]1254 }
[551]1255 pci = (PCNRITEM) WinSendMsg(Cnrs[z].hwndCnr,
1256 CM_QUERYRECORD,
1257 MPFROMP(pci),
1258 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
[2]1259 }
[814]1260 DosSleep(0); //26 Aug 07 GKY 1
[2]1261 Cnrs[z].numfiles = x;
[362]1262 if (Cnrs[z].numfiles)
[551]1263 qsort(Cnrs[z].ss, Cnrs[z].numfiles, sizeof(struct SS), CompSSNames);
[2]1264 }
1265
[551]1266 for (z = 0; z < numwindows; z++) {
1267 for (x = 0; x < Cnrs[z].numfiles; x++) {
[2]1268 Cnrs[z].ss[x].all = Cnrs[z].ss[x].unique = Cnrs[z].ss[x].newest =
[551]1269 Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].smallest =
1270 Cnrs[z].ss[x].largest = TRUE;
1271 for (w = 0; w < numwindows; w++) {
1272 if (w != z && Cnrs[w].numfiles) {
1273 bsres = (struct SS *)bsearch(Cnrs[z].ss[x].pci->pszFileName,
1274 Cnrs[w].ss, Cnrs[w].numfiles,
1275 sizeof(struct SS), CompSSNamesB);
1276 if (bsres) {
1277 Cnrs[z].ss[x].unique = FALSE;
1278 if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize >
1279 bsres->pci->cbFile + bsres->pci->easize)
1280 Cnrs[z].ss[x].smallest = FALSE;
1281 if (Cnrs[z].ss[x].pci->cbFile + Cnrs[z].ss[x].pci->easize <
1282 bsres->pci->cbFile + bsres->pci->easize)
1283 Cnrs[z].ss[x].largest = FALSE;
[897]1284 cmp = TestCDates(&bsres->pci->date, &bsres->pci->time,
1285 &Cnrs[z].ss[x].pci->date, &Cnrs[z].ss[x].pci->time);
1286 /*(Cnrs[z].ss[x].pci->date.year >
[551]1287 bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year <
1288 bsres->pci->date.
1289 year) ? FALSE : (Cnrs[z].
1290 ss[x].pci->
1291 date.month >
1292 bsres->pci->
1293 date.
1294 month) ? TRUE
1295 : (Cnrs[z].ss[x].pci->date.month <
1296 bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
1297 day >
1298 bsres->pci->date.
1299 day) ? TRUE : (Cnrs[z].
1300 ss[x].pci->
1301 date.day <
1302 bsres->
1303 pci->date.
1304 day) ?
1305 FALSE : (Cnrs[z].ss[x].pci->time.hours >
1306 bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
1307 time.hours <
1308 bsres->pci->time.
1309 hours) ? FALSE
1310 : (Cnrs[z].ss[x].pci->time.minutes >
1311 bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
1312 minutes <
1313 bsres->pci->time.
1314 minutes) ? FALSE
1315 : (Cnrs[z].ss[x].pci->time.seconds >
1316 bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
1317 seconds <
1318 bsres->pci->time.
[897]1319 seconds) ? FALSE : FALSE;*/
1320 if (cmp != 1)
[551]1321 Cnrs[z].ss[x].newest = FALSE;
[897]1322 /*cmp =
[551]1323 (Cnrs[z].ss[x].pci->date.year <
1324 bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year >
1325 bsres->pci->date.
1326 year) ? FALSE : (Cnrs[z].
1327 ss[x].pci->
1328 date.month <
1329 bsres->pci->
1330 date.
1331 month) ? TRUE
1332 : (Cnrs[z].ss[x].pci->date.month >
1333 bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.
1334 day <
1335 bsres->pci->date.
1336 day) ? TRUE : (Cnrs[z].
1337 ss[x].pci->
1338 date.day >
1339 bsres->
1340 pci->date.
1341 day) ?
1342 FALSE : (Cnrs[z].ss[x].pci->time.hours <
1343 bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->
1344 time.hours >
1345 bsres->pci->time.
1346 hours) ? FALSE
1347 : (Cnrs[z].ss[x].pci->time.minutes <
1348 bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.
1349 minutes >
1350 bsres->pci->time.
1351 minutes) ? FALSE
1352 : (Cnrs[z].ss[x].pci->time.seconds <
1353 bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.
1354 seconds >
1355 bsres->pci->time.
[897]1356 seconds) ? FALSE : FALSE;*/
1357 if (cmp != -1)
[551]1358 Cnrs[z].ss[x].oldest = FALSE;
1359 cmp = 0;
1360 break;
1361 }
1362 else
1363 Cnrs[z].ss[x].all = FALSE;
1364 }
[2]1365 }
[362]1366 if (Cnrs[z].ss[x].unique)
[551]1367 Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].newest = Cnrs[z].ss[x].all =
1368 Cnrs[z].ss[x].largest = Cnrs[z].ss[x].smallest = FALSE;
[748]1369 DosSleep(1);
[2]1370 }
[766]1371 DosSleep(1);
[2]1372 }
1373
[551]1374 switch (action) {
1375 case IDM_SELECTBOTH:
1376 for (z = 0; z < numwindows; z++) {
1377 for (x = 0; x < Cnrs[z].numfiles; x++) {
1378 if (Cnrs[z].ss[x].all)
1379 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1380 MPFROMP(Cnrs[z].ss[x].pci),
1381 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]1382 }
[814]1383 DosSleep(0); //26 Aug 07 GKY 1
[551]1384 }
1385 break;
1386 case IDM_SELECTMORE:
1387 for (z = 0; z < numwindows; z++) {
1388 for (x = 0; x < Cnrs[z].numfiles; x++) {
1389 if (!Cnrs[z].ss[x].unique)
1390 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1391 MPFROMP(Cnrs[z].ss[x].pci),
1392 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]1393 }
[814]1394 DosSleep(0); //26 Aug 07 GKY 1
[551]1395 }
1396 break;
1397 case IDM_SELECTONE:
1398 for (z = 0; z < numwindows; z++) {
1399 for (x = 0; x < Cnrs[z].numfiles; x++) {
1400 if (Cnrs[z].ss[x].unique)
1401 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1402 MPFROMP(Cnrs[z].ss[x].pci),
1403 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]1404 }
[814]1405 DosSleep(0); //26 Aug 07 GKY 1
[551]1406 }
1407 break;
1408 case IDM_SELECTNEWER:
1409 for (z = 0; z < numwindows; z++) {
1410 for (x = 0; x < Cnrs[z].numfiles; x++) {
1411 if (Cnrs[z].ss[x].newest)
1412 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1413 MPFROMP(Cnrs[z].ss[x].pci),
1414 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]1415 }
[814]1416 DosSleep(0); //26 Aug 07 GKY 1
[551]1417 }
1418 break;
1419 case IDM_SELECTOLDER:
1420 for (z = 0; z < numwindows; z++) {
1421 for (x = 0; x < Cnrs[z].numfiles; x++) {
1422 if (Cnrs[z].ss[x].oldest)
1423 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1424 MPFROMP(Cnrs[z].ss[x].pci),
1425 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]1426 }
[814]1427 DosSleep(0); //26 Aug 07 GKY 1
[551]1428 }
1429 break;
1430 case IDM_SELECTBIGGER:
1431 for (z = 0; z < numwindows; z++) {
1432 for (x = 0; x < Cnrs[z].numfiles; x++) {
1433 if (Cnrs[z].ss[x].largest)
1434 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1435 MPFROMP(Cnrs[z].ss[x].pci),
1436 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]1437 }
[814]1438 DosSleep(0); //26 Aug 07 GKY 1
[551]1439 }
1440 break;
1441 case IDM_SELECTSMALLER:
1442 for (z = 0; z < numwindows; z++) {
1443 for (x = 0; x < Cnrs[z].numfiles; x++) {
1444 if (Cnrs[z].ss[x].smallest)
1445 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1446 MPFROMP(Cnrs[z].ss[x].pci),
1447 MPFROM2SHORT(TRUE, CRA_SELECTED));
[2]1448 }
[814]1449 DosSleep(0); //26 Aug 07 GKY 1
[551]1450 }
1451 break;
[2]1452
[551]1453 case IDM_DESELECTBOTH:
1454 for (z = 0; z < numwindows; z++) {
1455 for (x = 0; x < Cnrs[z].numfiles; x++) {
1456 if (Cnrs[z].ss[x].all)
1457 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1458 MPFROMP(Cnrs[z].ss[x].pci),
1459 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1460 }
[814]1461 DosSleep(0); //26 Aug 07 GKY 1
[551]1462 }
1463 break;
1464 case IDM_DESELECTMORE:
1465 for (z = 0; z < numwindows; z++) {
1466 for (x = 0; x < Cnrs[z].numfiles; x++) {
1467 if (!Cnrs[z].ss[x].unique)
1468 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1469 MPFROMP(Cnrs[z].ss[x].pci),
1470 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1471 }
[814]1472 DosSleep(0); //26 Aug 07 GKY 1
[551]1473 }
1474 break;
1475 case IDM_DESELECTONE:
1476 for (z = 0; z < numwindows; z++) {
1477 for (x = 0; x < Cnrs[z].numfiles; x++) {
1478 if (Cnrs[z].ss[x].unique)
1479 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1480 MPFROMP(Cnrs[z].ss[x].pci),
1481 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1482 }
[814]1483 DosSleep(0); //26 Aug 07 GKY 1
[551]1484 }
1485 break;
1486 case IDM_DESELECTNEWER:
1487 for (z = 0; z < numwindows; z++) {
1488 for (x = 0; x < Cnrs[z].numfiles; x++) {
1489 if (Cnrs[z].ss[x].newest)
1490 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1491 MPFROMP(Cnrs[z].ss[x].pci),
1492 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1493 }
[814]1494 DosSleep(0); //26 Aug 07 GKY 1
[551]1495 }
1496 break;
1497 case IDM_DESELECTOLDER:
1498 for (z = 0; z < numwindows; z++) {
1499 for (x = 0; x < Cnrs[z].numfiles; x++) {
1500 if (Cnrs[z].ss[x].oldest)
1501 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1502 MPFROMP(Cnrs[z].ss[x].pci),
1503 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1504 }
[814]1505 DosSleep(0); //26 Aug 07 GKY 1
[551]1506 }
1507 break;
1508 case IDM_DESELECTBIGGER:
1509 for (z = 0; z < numwindows; z++) {
1510 for (x = 0; x < Cnrs[z].numfiles; x++) {
1511 if (Cnrs[z].ss[x].largest)
1512 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1513 MPFROMP(Cnrs[z].ss[x].pci),
1514 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1515 }
[814]1516 DosSleep(0); //26 Aug 07 GKY 1
[551]1517 }
1518 break;
1519 case IDM_DESELECTSMALLER:
1520 for (z = 0; z < numwindows; z++) {
1521 for (x = 0; x < Cnrs[z].numfiles; x++) {
1522 if (Cnrs[z].ss[x].smallest)
1523 WinSendMsg(Cnrs[z].hwndCnr, CM_SETRECORDEMPHASIS,
1524 MPFROMP(Cnrs[z].ss[x].pci),
1525 MPFROM2SHORT(FALSE, CRA_SELECTED));
[2]1526 }
[814]1527 DosSleep(0); //26 Aug 07 GKY 1
[551]1528 }
1529 break;
[2]1530 }
1531
[551]1532 FreeCnrs(Cnrs, numwindows);
[2]1533}
[793]1534
1535#pragma alloc_text(SELECT,UnHilite,SelectAll,DeselectAll,MarkAll,SetMask)
1536#pragma alloc_text(SELECT,SelectList)
1537#pragma alloc_text(SELECT1,Deselect,HideAll,RemoveAll,ExpandAll,InvertAll)
1538#pragma alloc_text(SELECT3,SpecialSelect)
1539#pragma alloc_text(SELECT4,FreeCnrs,SpecialSelect2,CompSSNames,CompSSNamesB)
Note: See TracBrowser for help on using the repository browser.