source: trunk/dll/collect.c@ 1017

Last change on this file since 1017 was 1017, checked in by Gregg Young, 17 years ago

fortify updates for threads dble free fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 76.4 KB
Line 
1
2/***********************************************************************
3
4 $Id: collect.c 1017 2008-05-26 03:02:59Z gyoung $
5
6 Collector
7
8 Copyright (c) 1993-98 M. Kimes
9 Copyright (c) 2003, 2008 Steven H. Levine
10
11 15 Oct 02 MK Baseline
12 10 Jan 04 SHL Avoid -1L byte counts
13 01 Aug 04 SHL Rework lstrip/rstrip usage
14 23 May 05 SHL Use QWL_USER
15 24 May 05 SHL Rework Win_Error usage
16 25 May 05 SHL Use ULONGLONG and CommaFmtULL
17 25 May 05 SHL Rework for FillInRecordFromFFB
18 05 Jun 05 SHL Use QWL_USER
19 06 Jun 05 SHL Indent -i2
20 06 Jun 05 SHL Make savedSortFlags static to avoid referencing garbage
21 24 Oct 05 SHL Sanitize handle references
22 24 Oct 05 SHL CollectorCnrWndProc: avoid excess writes to Status2 window
23 10 Nov 05 SHL CollectorCnrWndProc: correct missing button window updates
24 14 Jul 06 SHL Use Runtime_Error
25 27 Jul 06 SHL Avoid shutdown hang - pre3 typo
26 29 Jul 06 SHL Use xfgets_bstripcr
27 15 Aug 06 SHL Don't write garbage to CollectorFilter INI entry
28 15 Aug 06 SHL Rework SetMask args
29 18 Aug 06 SHL CollectorCnrWndProc: avoid freeing NULL pointer
30 31 Aug 06 SHL Disable Utilities->Seek and scan menu while busy
31 31 Aug 06 SHL Correct stop scan context menu enable/disable
32 30 Mar 07 GKY Remove GetPString for window class names
33 06 Apr 07 GKY Work around PM DragInfo and DrgFreeDISH limits
34 06 Apr 07 GKY Add some error checking in drag/drop
35 19 Apr 07 SHL Use FreeDragInfoData. Add more drag/drop error checks.
36 12 May 07 SHL Use dcd->ulItemsToUnHilite
37 10 Jun 07 GKY Add CheckPmDrgLimit including IsFm2Window as part of work around PM drag limit
38 05 Jul 07 SHL CollectorCnrWndProc: just warn if busy
39 02 Aug 07 SHL Sync with CNRITEM mods
40 06 Aug 07 GKY Reduce DosSleep times (ticket 148)
41 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
42 26 Aug 07 GKY DosSleep(1) in loops changed to (0)
43 22 Nov 07 GKY Use CopyPresParams to fix presparam inconsistencies in menus
44 10 Jan 08 SHL Sync with CfgDlgProc mods
45 10 Feb 08 GKY Implement bubble help for bitmap menu items
46 15 Feb 08 SHL Sync with settings menu rework
47 15 Feb 08 GKY Fix attempt to free container items that were never inserted
48 15 Feb 08 GKY Fix "collect" so it updates recollected files and unhides them if needed
49 29 Feb 08 GKY Use xfree where appropriate
50
51***********************************************************************/
52
53#include <stdlib.h>
54#include <string.h>
55#include <ctype.h>
56#include <share.h>
57#include <limits.h>
58#include <process.h> // _beginthread
59
60#define INCL_DOS // QSV_MS_COUNT
61#define INCL_WIN
62#define INCL_DOSERRORS
63#define INCL_LONGLONG
64
65#include "fm3dlg.h"
66#include "fm3str.h"
67#include "mle.h"
68#include "grep.h"
69#include "comp.h"
70#include "arccnrs.h" // StartArcCnr
71#include "filldir.h" // EmptyCnr...
72#include "strutil.h" // GetPString
73#include "errutil.h" // Runtime_Error
74#include "tmrsvcs.h" // ITIMER_DESC
75#include "notebook.h" // CfgDlgProc
76#include "command.h" // RunCommand
77#include "fm3dll.h"
78
79#include "fortify.h"
80
81#pragma data_seg(DATA1)
82
83static PSZ pszSrcFile = __FILE__;
84
85MRESULT EXPENTRY CollectorFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1,
86 MPARAM mp2)
87{
88 return CommonFrameWndProc(COLLECTOR_CNR, hwnd, msg, mp1, mp2);
89}
90
91MRESULT EXPENTRY CollectorTextProc(HWND hwnd, ULONG msg, MPARAM mp1,
92 MPARAM mp2)
93{
94 DIRCNRDATA *dcd;
95
96 static BOOL emphasized = FALSE;
97 static HWND hwndButtonPopup = (HWND) 0;
98 static ULONG timestamp = ULONG_MAX;
99 static USHORT lastid = 0;
100
101 switch (msg) {
102 case WM_CREATE:
103 return CommonTextProc(hwnd, msg, mp1, mp2);
104
105 case UM_CONTEXTMENU:
106 case WM_CONTEXTMENU:
107 {
108 USHORT id;
109
110 id = WinQueryWindowUShort(hwnd, QWS_ID);
111 switch (id) {
112 case DIR_SELECTED:
113 case DIR_VIEW:
114 case DIR_SORT:
115 {
116 POINTL ptl = { 0, 0 };
117 SWP swp;
118
119 if (hwndButtonPopup)
120 WinDestroyWindow(hwndButtonPopup);
121 if (id == lastid) {
122 ULONG check;
123
124 DosQuerySysInfo(QSV_MS_COUNT,
125 QSV_MS_COUNT, &check, sizeof(check));
126 if (check < timestamp + 500) {
127 lastid = 0;
128 goto MenuAbort;
129 }
130 }
131 hwndButtonPopup = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id);
132 if (hwndButtonPopup) {
133 WinSetWindowUShort(hwndButtonPopup, QWS_ID, id);
134 dcd = WinQueryWindowPtr(WinWindowFromID(WinQueryWindow(hwnd,
135 QW_PARENT),
136 COLLECTOR_CNR), QWL_USER);
137 if (id == DIR_VIEW) {
138 if (dcd) {
139 SetViewMenu(hwndButtonPopup, dcd->flWindowAttr);
140 SetDetailsSwitches(hwndButtonPopup, dcd);
141 CopyPresParams(hwndButtonPopup, hwnd);
142 }
143
144 /* don't have tree view in collector */
145 WinSendMsg(hwndButtonPopup,
146 MM_DELETEITEM,
147 MPFROM2SHORT(IDM_TREEVIEW, FALSE), MPVOID);
148
149 }
150 else if (id == DIR_SORT) {
151 if (dcd)
152 SetSortChecks(hwndButtonPopup, dcd->sortFlags);
153 }
154 ptl.x = 0;
155 if (WinPopupMenu(HWND_OBJECT,
156 HWND_OBJECT,
157 hwndButtonPopup, -32767, -32767, 0, 0)) {
158 WinQueryWindowPos(hwndButtonPopup, &swp);
159 ptl.y = -(swp.cy + 2);
160 }
161 else {
162 WinQueryWindowPos(hwnd, &swp);
163 ptl.y = swp.cy + 2;
164 }
165 if (WinPopupMenu(hwnd,
166 hwnd,
167 hwndButtonPopup,
168 ptl.x,
169 ptl.y,
170 0,
171 PU_HCONSTRAIN | PU_VCONSTRAIN |
172 PU_KEYBOARD | PU_MOUSEBUTTON1)) {
173 CenterOverWindow(hwndButtonPopup);
174 PaintRecessedWindow(hwnd, NULLHANDLE, FALSE, FALSE);
175 }
176 }
177 }
178 break;
179 default:
180 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
181 COLLECTOR_CNR),
182 WM_CONTROL,
183 MPFROM2SHORT(COLLECTOR_CNR, CN_CONTEXTMENU), MPVOID);
184 break;
185 }
186 }
187 MenuAbort:
188 if (msg == UM_CONTEXTMENU)
189 return 0;
190 break;
191
192 case WM_MENUEND:
193 if (hwndButtonPopup == (HWND) mp2) {
194 lastid = WinQueryWindowUShort((HWND) mp2, QWS_ID);
195 WinDestroyWindow(hwndButtonPopup);
196 hwndButtonPopup = (HWND) 0;
197 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &timestamp,
198 sizeof(timestamp));
199 switch (lastid) {
200 case DIR_SELECTED:
201 case DIR_VIEW:
202 case DIR_SORT:
203 PaintRecessedWindow(hwnd, NULLHANDLE, TRUE, FALSE);
204 break;
205 }
206 }
207 break;
208
209 case WM_COMMAND:
210 {
211 DIRCNRDATA *dcd;
212 MRESULT mr;
213
214 mr = WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd,
215 QW_PARENT),
216 COLLECTOR_CNR), msg, mp1, mp2);
217 if (hwndButtonPopup &&
218 SHORT1FROMMP(mp1) > IDM_DETAILSTITLES &&
219 SHORT1FROMMP(mp1) < IDM_DETAILSSETUP) {
220 dcd = WinQueryWindowPtr(WinWindowFromID(WinQueryWindow(hwnd,
221 QW_PARENT),
222 COLLECTOR_CNR), QWL_USER);
223 if (dcd)
224 SetDetailsSwitches(hwndButtonPopup, dcd);
225 }
226 return mr;
227 }
228
229 case WM_MOUSEMOVE:
230 {
231 USHORT id = WinQueryWindowUShort(hwnd, QWS_ID);
232 char *s = NULL;
233
234 if (fOtherHelp) {
235 if ((!hwndBubble ||
236 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&
237 !WinQueryCapture(HWND_DESKTOP)) {
238 switch (id) {
239 case DIR_SELECTED:
240 s = GetPString(IDS_COLSELECTEDHELP);
241 break;
242 case DIR_TOTALS:
243 s = GetPString(IDS_COLTOTALSHELP);
244 break;
245 case DIR_VIEW:
246 s = GetPString(IDS_DIRCNRVIEWHELP);
247 break;
248 case DIR_SORT:
249 s = GetPString(IDS_DIRCNRSORTHELP);
250 break;
251 case DIR_FILTER:
252 s = GetPString(IDS_DIRCNRFILTERHELP);
253 break;
254 default:
255 break;
256 }
257 if (s)
258 MakeBubble(hwnd, TRUE, s);
259 else if (hwndBubble)
260 WinDestroyWindow(hwndBubble);
261 }
262 }
263 switch (id) {
264 case DIR_FILTER:
265 case DIR_SORT:
266 case DIR_VIEW:
267 case DIR_SELECTED:
268 return CommonTextButton(hwnd, msg, mp1, mp2);
269 }
270 }
271 break;
272
273 case WM_BUTTON3UP:
274 case WM_BUTTON1UP:
275 case WM_BUTTON3DOWN:
276 case WM_BUTTON1DOWN:
277 {
278 USHORT id;
279
280 id = WinQueryWindowUShort(hwnd, QWS_ID);
281 switch (id) {
282 case DIR_FILTER:
283 case DIR_SORT:
284 case DIR_VIEW:
285 case DIR_SELECTED:
286 return CommonTextButton(hwnd, msg, mp1, mp2);
287 }
288 }
289 break;
290
291 case UM_CLICKED:
292 case UM_CLICKED3:
293 {
294 USHORT id, cmd = 0;
295
296 id = WinQueryWindowUShort(hwnd, QWS_ID);
297 switch (id) {
298 case DIR_VIEW:
299 case DIR_SORT:
300 case DIR_SELECTED:
301 PostMsg(hwnd, UM_CONTEXTMENU, MPVOID, MPVOID);
302 break;
303 case DIR_FILTER:
304 cmd = IDM_FILTER;
305 break;
306 default:
307 break;
308 }
309 if (cmd)
310 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
311 COLLECTOR_CNR),
312 WM_COMMAND, MPFROM2SHORT(cmd, 0), MPVOID);
313 }
314 return 0;
315
316 case DM_DROP:
317 case DM_DRAGOVER:
318 case DM_DRAGLEAVE:
319 case DM_DROPHELP:
320 if (msg == DM_DRAGOVER) {
321 if (!emphasized) {
322 emphasized = TRUE;
323 DrawTargetEmphasis(hwnd, emphasized);
324 }
325 }
326 else {
327 if (emphasized) {
328 emphasized = FALSE;
329 DrawTargetEmphasis(hwnd, emphasized);
330 }
331 }
332 {
333 CNRDRAGINFO cnd;
334 USHORT dcmd;
335
336 switch (msg) {
337 case DM_DROP:
338 dcmd = CN_DROP;
339 break;
340 case DM_DRAGOVER:
341 dcmd = CN_DRAGOVER;
342 break;
343 case DM_DRAGLEAVE:
344 dcmd = CN_DRAGLEAVE;
345 break;
346 case DM_DROPHELP:
347 dcmd = CN_DROPHELP;
348 break;
349 }
350 memset(&cnd, 0, sizeof(cnd));
351 cnd.pDragInfo = (PDRAGINFO) mp1;
352 cnd.pRecord = NULL;
353 return WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), WM_CONTROL,
354 MPFROM2SHORT(COLLECTOR_CNR, dcmd), MPFROMP(&cnd));
355 }
356 }
357 return PFNWPStatic(hwnd, msg, mp1, mp2);
358}
359
360MRESULT EXPENTRY CollectorClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1,
361 MPARAM mp2)
362{
363 switch (msg) {
364 case UM_CONTAINERHWND:
365 return MRFROMLONG(WinWindowFromID(hwnd, COLLECTOR_CNR));
366
367 case UM_VIEWSMENU:
368 return MRFROMLONG(CheckMenu(hwnd, &CollectorCnrMenu, COLLECTORCNR_POPUP));
369
370 case MM_PORTHOLEINIT:
371 case WM_INITMENU:
372 case UM_INITMENU:
373 case UM_CONTAINER_FILLED:
374 case UM_FILESMENU:
375 case UM_UPDATERECORD:
376 case UM_UPDATERECORDLIST:
377 return WinSendMsg(WinWindowFromID(hwnd, COLLECTOR_CNR), msg, mp1, mp2);
378
379 case WM_PSETFOCUS:
380 case WM_SETFOCUS:
381 if (mp2)
382 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);
383 break;
384
385 case UM_FOCUSME:
386 WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, COLLECTOR_CNR));
387 break;
388
389 case WM_PAINT:
390 {
391 HPS hps;
392 RECTL rcl;
393
394 hps = WinBeginPaint(hwnd, NULLHANDLE, NULL);
395 if (hps) {
396 WinQueryWindowRect(hwnd, &rcl);
397 WinFillRect(hps, &rcl, CLR_PALEGRAY);
398 CommonTextPaint(hwnd, hps);
399 WinEndPaint(hps);
400 }
401 }
402 break;
403
404 case UM_SIZE:
405 case WM_SIZE:
406 if (msg == UM_SIZE) {
407 SWP swp;
408
409 WinQueryWindowPos(hwnd, &swp);
410 mp1 = MPFROM2SHORT(swp.cx, swp.cy);
411 mp2 = MPFROM2SHORT(swp.cx, swp.cy);
412 }
413 {
414 USHORT cx, cy, bx;
415
416 cx = SHORT1FROMMP(mp2);
417 cy = SHORT2FROMMP(mp2);
418 WinSetWindowPos(WinWindowFromID(hwnd, COLLECTOR_CNR), HWND_TOP,
419 0, 0, cx, cy - 24, SWP_SHOW | SWP_MOVE | SWP_SIZE);
420 WinSetWindowPos(WinWindowFromID(hwnd, DIR_TOTALS), HWND_TOP,
421 2,
422 cy - 22,
423 (cx / 3) - 2, 20, SWP_SHOW | SWP_MOVE | SWP_SIZE);
424 WinSetWindowPos(WinWindowFromID(hwnd, DIR_SELECTED), HWND_TOP,
425 2 + (cx / 3) + 2,
426 cy - 22,
427 (cx / 3) - 2, 20, SWP_SHOW | SWP_MOVE | SWP_SIZE);
428 bx = (cx - (2 + (((cx / 3) + 2) * 2))) / 3;
429 WinSetWindowPos(WinWindowFromID(hwnd, DIR_VIEW), HWND_TOP,
430 2 + (((cx / 3) + 2) * 2),
431 cy - 22, bx - 4, 20, SWP_SHOW | SWP_MOVE | SWP_SIZE);
432 WinSetWindowPos(WinWindowFromID(hwnd, DIR_SORT), HWND_TOP,
433 2 + (((cx / 3) + 2) * 2) + bx,
434 cy - 22, bx - 4, 20, SWP_SHOW | SWP_MOVE | SWP_SIZE);
435 WinSetWindowPos(WinWindowFromID(hwnd, DIR_FILTER), HWND_TOP,
436 2 + (((cx / 3) + 2) * 2) + (bx * 2),
437 cy - 22, bx - 4, 20, SWP_SHOW | SWP_MOVE | SWP_SIZE);
438 }
439 CommonTextPaint(hwnd, NULLHANDLE);
440 if (msg == UM_SIZE) {
441 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0,
442 SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE);
443 return 0;
444 }
445 break;
446
447 case UM_COMMAND:
448 case WM_COMMAND:
449 case WM_CONTROL:
450 case WM_CLOSE:
451 return WinSendMsg(WinWindowFromID(hwnd, COLLECTOR_CNR), msg, mp1, mp2);
452 }
453 return WinDefWindowProc(hwnd, msg, mp1, mp2);
454}
455
456MRESULT EXPENTRY CollectorObjWndProc(HWND hwnd, ULONG msg,
457 MPARAM mp1, MPARAM mp2)
458{
459 ULONG size;
460 DIRCNRDATA *dcd;
461
462 switch (msg) {
463 case WM_CREATE:
464 break;
465
466 case DM_PRINTOBJECT:
467 return MRFROMLONG(DRR_TARGET);
468
469 case DM_DISCARDOBJECT:
470 dcd = INSTDATA(hwnd);
471 if (fFM2Deletes && dcd) {
472 LISTINFO *li;
473 CNRDRAGINFO cni;
474
475 cni.pRecord = NULL;
476 cni.pDragInfo = (PDRAGINFO) mp1;
477 li = DoFileDrop(dcd->hwndCnr, NULL, FALSE, MPVOID, MPFROMP(&cni));
478 CheckPmDrgLimit(cni.pDragInfo);
479 if (li) {
480 li->type = fDefaultDeletePerm ? IDM_PERMDELETE : IDM_DELETE;
481 if (!PostMsg(hwnd, UM_MASSACTION, MPFROMP(li), MPVOID))
482 FreeListInfo(li);
483 else
484 return MRFROMLONG(DRR_SOURCE);
485 }
486 }
487 return MRFROMLONG(DRR_TARGET);
488
489 case UM_UPDATERECORDLIST:
490 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
491 if (dcd && mp1) {
492 INT numentries = 0;
493 CHAR **list = (CHAR **) mp1;
494
495 while (list[numentries])
496 numentries++;
497 if (numentries)
498 UpdateCnrList(dcd->hwndCnr, list, numentries, FALSE, dcd);
499 }
500 return 0;
501
502 case UM_SETUP:
503 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
504 if (dcd) {
505 /* set unique id */
506 WinSetWindowUShort(hwnd,
507 QWS_ID,
508 COLLECTOROBJ_FRAME + (COLLECTOR_FRAME - dcd->id));
509 dcd->hwndObject = hwnd;
510 // 09 Feb 08 SHL fixme to be sure applet does not really need this
511 // if (ParentIsDesktop(hwnd, dcd->hwndParent))
512 // DosSleep(100); //05 Aug 07 GKY 250
513 }
514 else
515 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
516 return 0;
517
518 case UM_COMMAND:
519 if (mp1) {
520 LISTINFO *li = (LISTINFO *) mp1;
521
522 switch (li->type) {
523 case IDM_DOITYOURSELF:
524 case IDM_APPENDTOCLIP:
525 case IDM_SAVETOCLIP:
526 case IDM_ARCHIVE:
527 case IDM_ARCHIVEM:
528 case IDM_VIEW:
529 case IDM_VIEWTEXT:
530 case IDM_VIEWBINARY:
531 case IDM_VIEWARCHIVE:
532 case IDM_EDIT:
533 case IDM_EDITTEXT:
534 case IDM_EDITBINARY:
535 case IDM_OBJECT:
536 case IDM_SHADOW:
537 case IDM_SHADOW2:
538 case IDM_PRINT:
539 case IDM_ATTRS:
540 case IDM_DELETE:
541 case IDM_PERMDELETE:
542 case IDM_FAKEEXTRACT:
543 case IDM_FAKEEXTRACTM:
544 case IDM_MCIPLAY:
545 case IDM_UPDATE:
546 if (PostMsg(hwnd, UM_MASSACTION, mp1, mp2))
547 return (MRESULT) TRUE;
548 break;
549 default:
550 if (PostMsg(hwnd, UM_ACTION, mp1, mp2))
551 return (MRESULT) TRUE;
552 }
553 }
554 return 0;
555
556 case UM_COLLECT:
557 DosError(FERR_DISABLEHARDERR);
558 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
559 if (dcd) {
560 LISTINFO *li = (LISTINFO *) mp1;
561 INT x;
562 FILEFINDBUF4L fb4;
563 HDIR hdir;
564 ULONG nm;
565 PCNRITEM pci, pciFirst, pciT, pciP = NULL;
566 RECORDINSERT ri;
567 ULONG ulMaxFiles;
568 ULONGLONG ullTotalBytes;
569 CHAR fullname[CCHMAXPATH];
570
571 if (!hwndStatus) {
572 WinSetWindowText(WinWindowFromID(dcd->hwndClient, DIR_SELECTED),
573 GetPString(IDS_COLLECTINGTEXT));
574 }
575 else {
576 if (WinQueryFocus(HWND_DESKTOP) == dcd->hwndCnr)
577 WinSetWindowText(hwndStatus, GetPString(IDS_COLLECTINGTEXT));
578 }
579
580 for (ulMaxFiles = 0; li->list[ulMaxFiles]; ulMaxFiles++) ; // Count
581
582 if (ulMaxFiles) {
583 pci = WinSendMsg(dcd->hwndCnr, CM_ALLOCRECORD,
584 MPFROMLONG(EXTRA_RECORD_BYTES),
585 MPFROMLONG(ulMaxFiles));
586 if (!pci) {
587 Runtime_Error(pszSrcFile, __LINE__, "CM_ALLOCRECORD %u failed",
588 ulMaxFiles);
589 break;
590 }
591 else {
592 ITIMER_DESC itdSleep = { 0 }; // 06 Feb 08 SHL
593 InitITimer(&itdSleep, 500); // Sleep every 500 mSec
594 pciFirst = pci;
595 // 04 Jan 08 SHL fixme like comp.c if CM_ALLOCRECORD returns unexpected record count
596 for (x = 0; li->list[x]; x++) {
597 nm = 1;
598 hdir = HDIR_CREATE;
599 DosError(FERR_DISABLEHARDERR);
600 if (FindCnrRecord(dcd->hwndCnr,
601 li->list[x],
602 NULL,
603 FALSE,
604 FALSE,
605 TRUE)) {
606 pci = UpdateCnrRecord(dcd->hwndCnr, li->list[x], FALSE, dcd);
607 if (Filter((PMINIRECORDCORE) pci, (PVOID) & dcd->mask)) {
608 pci->rc.flRecordAttr &= ~CRA_FILTERED;
609 WinSendMsg(dcd->hwndCnr, CM_INVALIDATERECORD, MPVOID,
610 MPFROM2SHORT(0, CMA_REPOSITION | CMA_ERASE));
611 }
612 pci = (PCNRITEM) pci->rc.preccNextRecord;
613 if (pciP)
614 pciP->rc.preccNextRecord = (PMINIRECORDCORE) pci;
615 else
616 pciFirst = pci;
617 }
618 else if (*li->list[x] &&
619 !DosQueryPathInfo(li->list[x], FIL_QUERYFULLNAME,
620 fullname, sizeof(fullname)) &&
621 !IsRoot(fullname) &&
622 !xDosFindFirst(fullname,
623 &hdir,
624 FILE_NORMAL | FILE_DIRECTORY |
625 FILE_ARCHIVED | FILE_SYSTEM |
626 FILE_HIDDEN | FILE_READONLY,
627 &fb4, sizeof(fb4), &nm, FIL_QUERYEASIZEL)) {
628 DosFindClose(hdir);
629 priority_normal();
630 *fb4.achName = 0;
631 ullTotalBytes = FillInRecordFromFFB(dcd->hwndCnr,
632 pci,
633 fullname, &fb4, FALSE, dcd);
634 dcd->ullTotalBytes += ullTotalBytes;
635 pciP = pci;
636 pci = (PCNRITEM) pci->rc.preccNextRecord;
637 }
638 else {
639 // Oops - fixme to complain?
640 pciT = pci;
641 pci = (PCNRITEM) pci->rc.preccNextRecord;
642 if (pciP)
643 pciP->rc.preccNextRecord = (PMINIRECORDCORE) pci;
644 else
645 pciFirst = pci;
646 if (pciT)
647 FreeCnrItemData(pciT); // FreeCnrItem(hwnd, pciT);
648 ulMaxFiles--; // Remember gone
649 }
650 SleepIfNeeded(&itdSleep, 1); // 09 Feb 08 SHL
651 // DosSleep(0); //26 Aug 07 GKY 1 // 09 Feb 08 SHL
652 } // for
653 if (ulMaxFiles) {
654 // Some files OK
655 memset(&ri, 0, sizeof(RECORDINSERT));
656 ri.cb = sizeof(RECORDINSERT);
657 ri.pRecordOrder = (PRECORDCORE) CMA_END;
658 ri.pRecordParent = (PRECORDCORE) 0;
659 ri.zOrder = (ULONG) CMA_TOP;
660 ri.cRecordsInsert = ulMaxFiles;
661 ri.fInvalidateRecord = TRUE;
662 WinSendMsg(dcd->hwndCnr,
663 CM_INSERTRECORD, MPFROMP(pciFirst), MPFROMP(&ri));
664 PostMsg(dcd->hwndCnr, UM_RESCAN, MPVOID, MPVOID);
665 }
666 }
667 }
668 }
669 if (dcd->flWindowAttr & CV_DETAIL)
670 WinSendDlgItemMsg(hwnd,
671 COLLECTOR_CNR,
672 CM_INVALIDATERECORD,
673 MPVOID, MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION));
674 return 0;
675
676 case UM_COLLECTFROMFILE:
677 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
678 if (dcd && mp1) {
679 FILESTATUS4L fs4;
680 PCNRITEM pci;
681 RECORDINSERT ri;
682 CHAR fullname[1024], *p;
683 FILE *fp;
684 ULONG errs = 0;
685 BOOL first = FALSE;
686 size_t c;
687
688 fp = _fsopen((CHAR *)mp1, "r", SH_DENYNO);
689 if (fp) {
690 while (!feof(fp)) {
691 // Avoid too much noise if collecting from binary file - oops
692 if (!fgets(fullname, sizeof(fullname), fp)) {
693 if (ferror(fp))
694 Runtime_Error(pszSrcFile, __LINE__, "fgets");
695 break;
696 }
697
698 c = strlen(fullname);
699 if (c + 1 >= sizeof(fullname))
700 errs++;
701 else if (!c || (fullname[c - 1] != '\n' && fullname[c - 1] != '\r'))
702 errs++;
703 else {
704 bstripcr(fullname);
705
706 if (*fullname == '\"') {
707 memmove(fullname, fullname + 1, strlen(fullname) + 1);
708 lstrip(fullname);
709 p = strchr(fullname, '\"');
710 if (p)
711 *p = 0;
712 rstrip(fullname);
713 }
714 else {
715 p = strchr(fullname, ' ');
716 if (p)
717 *p = 0;
718 }
719 /* fullname now contains name of file to collect */
720 DosError(FERR_DISABLEHARDERR);
721 if (FindCnrRecord(dcd->hwndCnr,
722 fullname,
723 NULL,
724 FALSE,
725 FALSE,
726 TRUE)) {
727 pci = UpdateCnrRecord(dcd->hwndCnr, fullname, FALSE, dcd);
728 if (Filter((PMINIRECORDCORE) pci, (PVOID) & dcd->mask)) {
729 pci->rc.flRecordAttr &= ~CRA_FILTERED;
730 WinSendMsg(dcd->hwndCnr, CM_INVALIDATERECORD, MPVOID,
731 MPFROM2SHORT(0, CMA_REPOSITION | CMA_ERASE));
732 }
733 /*pci = (PCNRITEM) pci->rc.preccNextRecord;
734 if (pciP)
735 pciP->rc.preccNextRecord = (PMINIRECORDCORE) pci;
736 else
737 pciFirst = pci;*/
738 }
739 else if (IsFullName(fullname) &&
740 !IsRoot(fullname) &&
741 !DosQueryPathInfo(fullname,
742 FIL_QUERYEASIZEL,
743 &fs4,
744 sizeof(fs4))) {
745 /* collect it */
746 pci = WinSendMsg(dcd->hwndCnr,
747 CM_ALLOCRECORD,
748 MPFROMLONG(EXTRA_RECORD_BYTES),
749 MPFROMLONG(1));
750 if (pci) {
751 dcd->ullTotalBytes += FillInRecordFromFSA(dcd->hwndCnr, pci,
752 fullname,
753 &fs4, FALSE, dcd);
754 memset(&ri, 0, sizeof(RECORDINSERT));
755 ri.cb = sizeof(RECORDINSERT);
756 ri.pRecordOrder = (PRECORDCORE) CMA_END;
757 ri.pRecordParent = (PRECORDCORE) 0;
758 ri.zOrder = (ULONG) CMA_TOP;
759 ri.cRecordsInsert = 1;
760 ri.fInvalidateRecord = TRUE;
761 WinSendMsg(dcd->hwndCnr, CM_INSERTRECORD,
762 MPFROMP(pci), MPFROMP(&ri));
763 }
764 }
765 else
766 errs++;
767 }
768 if (errs > (first ? 0 : 50)) {
769 /* prevent runaway on bad file */
770 APIRET ret = saymsg(MB_YESNO, dcd->hwndCnr,
771 GetPString(IDS_COLLECTNOLISTHDRTEXT),
772 GetPString(IDS_COLLECTNOLISTTEXT),
773 (CHAR *)mp1);
774
775 if (ret == MBID_NO)
776 break;
777 if (!first)
778 errs = 0;
779 else
780 first = FALSE;
781 }
782 } // while not eof
783 fclose(fp);
784 }
785 }
786 xfree(mp1, pszSrcFile, __LINE__);
787 return 0;
788
789 case UM_SELECT:
790 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
791 if (dcd) {
792 switch (SHORT1FROMMP(mp1)) {
793 case IDM_SELECTLIST:
794 {
795 CHAR filename[CCHMAXPATH], *p, *pp;
796
797 strcpy(filename, "*.LST");
798 size = CCHMAXPATH;
799 PrfQueryProfileData(fmprof, appname, "SaveToListName", filename,
800 &size);
801 pp = strrchr(filename, '\\');
802 if (!pp)
803 pp = filename;
804 p = strrchr(pp, '.');
805 if (p && *(p + 1) && p > pp + 1) {
806 if (pp > filename)
807 pp++;
808 *pp = '*';
809 pp++;
810 if (p > pp)
811 memmove(pp, p, strlen(p) + 1);
812 }
813 if (insert_filename(hwnd, filename, FALSE, FALSE))
814 SelectList(dcd->hwndCnr, TRUE, FALSE, FALSE, NULL, filename,
815 NULL);
816 }
817 break;
818 case IDM_SELECTALL:
819 SelectAll(dcd->hwndCnr, TRUE, TRUE, NULL, NULL, FALSE);
820 break;
821 case IDM_DESELECTALL:
822 DeselectAll(dcd->hwndCnr, TRUE, TRUE, NULL, NULL, FALSE);
823 break;
824 case IDM_SELECTALLFILES:
825 SelectAll(dcd->hwndCnr, TRUE, FALSE, NULL, NULL, FALSE);
826 break;
827 case IDM_DESELECTALLFILES:
828 DeselectAll(dcd->hwndCnr, TRUE, FALSE, NULL, NULL, FALSE);
829 break;
830 case IDM_SELECTALLDIRS:
831 SelectAll(dcd->hwndCnr, FALSE, TRUE, NULL, NULL, FALSE);
832 break;
833 case IDM_DESELECTALLDIRS:
834 DeselectAll(dcd->hwndCnr, FALSE, TRUE, NULL, NULL, FALSE);
835 break;
836 case IDM_DESELECTMASK:
837 case IDM_SELECTMASK:
838 {
839 MASK mask;
840 PCNRITEM pci = (PCNRITEM) mp2;
841
842 memset(&mask, 0, sizeof(MASK));
843 mask.fNoAttribs = TRUE;
844 mask.fNoDirs = TRUE;
845 mask.fText = TRUE;
846 strcpy(mask.prompt,
847 GetPString((SHORT1FROMMP(mp1) == IDM_SELECTMASK) ?
848 IDS_SELECTFILTERTEXT : IDS_DESELECTFILTERTEXT));
849 if (pci && (INT) pci != -1)
850 strcpy(mask.szMask, pci->pszFileName);
851 if (WinDlgBox(HWND_DESKTOP, dcd->hwndCnr, PickMaskDlgProc,
852 FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) {
853 if (SHORT1FROMMP(mp1) == IDM_SELECTMASK)
854 SelectAll(dcd->hwndCnr, TRUE, TRUE, mask.szMask, mask.szText,
855 FALSE);
856 else
857 DeselectAll(dcd->hwndCnr, TRUE, TRUE, mask.szMask, mask.szText,
858 FALSE);
859 }
860 }
861
862 case IDM_DESELECTCLIP:
863 case IDM_SELECTCLIP:
864 {
865 CHAR **list;
866
867 list = ListFromClipboard(hwnd);
868 if (list) {
869 SelectList(dcd->hwndCnr, TRUE, FALSE,
870 (SHORT1FROMMP(mp1) == IDM_DESELECTCLIP),
871 NULL, NULL, list);
872 FreeList(list);
873 }
874 }
875 break;
876
877 case IDM_INVERT:
878 InvertAll(dcd->hwndCnr);
879 break;
880 }
881 }
882 return 0;
883
884 case UM_MASSACTION:
885 if (mp1) {
886 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
887 if (dcd) {
888 WORKER *wk;
889# ifdef FORTIFY
890 Fortify_EnterScope();
891# endif
892 wk = xmallocz(sizeof(WORKER), pszSrcFile, __LINE__);
893 if (!wk)
894 FreeListInfo((LISTINFO *) mp1);
895 else {
896 wk->size = sizeof(WORKER);
897 wk->hwndCnr = dcd->hwndCnr;
898 wk->hwndParent = dcd->hwndParent;
899 wk->hwndFrame = dcd->hwndFrame;
900 wk->hwndClient = dcd->hwndClient;
901 wk->li = (LISTINFO *) mp1;
902 strcpy(wk->directory, dcd->directory);
903 if (_beginthread(MassAction, NULL, 122880, (PVOID) wk) == -1) {
904 Runtime_Error(pszSrcFile, __LINE__,
905 GetPString(IDS_COULDNTSTARTTHREADTEXT));
906 xfree(wk, pszSrcFile, __LINE__);
907# ifdef FORTIFY
908 Fortify_LeaveScope();
909# endif
910 FreeListInfo((LISTINFO *) mp1);
911 }
912 }
913 }
914 }
915 return 0;
916
917 case UM_ACTION:
918 if (mp1) {
919 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
920 if (dcd) {
921 WORKER *wk;
922# ifdef FORTIFY
923 Fortify_EnterScope();
924# endif
925 wk = xmallocz(sizeof(WORKER), pszSrcFile, __LINE__);
926 if (!wk)
927 FreeListInfo((LISTINFO *) mp1);
928 else {
929 wk->size = sizeof(WORKER);
930 wk->hwndCnr = dcd->hwndCnr;
931 wk->hwndParent = dcd->hwndParent;
932 wk->hwndFrame = dcd->hwndFrame;
933 wk->hwndClient = dcd->hwndClient;
934 wk->li = (LISTINFO *) mp1;
935 strcpy(wk->directory, dcd->directory);
936 if (_beginthread(Action, NULL, 122880, (PVOID) wk) == -1) {
937 Runtime_Error(pszSrcFile, __LINE__,
938 GetPString(IDS_COULDNTSTARTTHREADTEXT));
939 xfree(wk, pszSrcFile, __LINE__);
940# ifdef FORTIFY
941 Fortify_LeaveScope();
942# endif
943 FreeListInfo((LISTINFO *) mp1);
944 }
945 }
946 }
947 }
948 return 0;
949
950 case WM_CLOSE:
951 WinDestroyWindow(hwnd);
952 break;
953
954 case WM_DESTROY:
955 dcd = WinQueryWindowPtr(hwnd, QWL_USER);
956 if (dcd) {
957 INT x;
958
959 dcd->stopflag = 1;
960 // Allow other threads to honor stop request
961 for (x = 0; x < 100 && dcd->amextracted; x++)
962 DosSleep(10);
963 if (dcd->amextracted)
964 Runtime_Error(pszSrcFile, __LINE__, "still busy");
965 WinSendMsg(dcd->hwndCnr, UM_CLOSE, MPVOID, MPVOID);
966 FreeList(dcd->lastselection);
967 xfree(dcd, pszSrcFile, __LINE__);
968# ifdef FORTIFY
969 Fortify_LeaveScope();
970# endif
971 WinSetWindowPtr(dcd->hwndCnr, QWL_USER, NULL);
972 }
973 DosPostEventSem(CompactSem);
974 if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID))
975 WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
976 break;
977 }
978 return WinDefWindowProc(hwnd, msg, mp1, mp2);
979}
980
981MRESULT EXPENTRY CollectorCnrWndProc(HWND hwnd, ULONG msg, MPARAM mp1,
982 MPARAM mp2)
983{
984 DIRCNRDATA *dcd = INSTDATA(hwnd);
985 ULONG size;
986
987 static INT savedSortFlags;
988
989 switch (msg) {
990 case DM_PRINTOBJECT:
991 return MRFROMLONG(DRR_TARGET);
992
993 case DM_DISCARDOBJECT:
994 if (dcd)
995 return WinSendMsg(dcd->hwndObject, msg, mp1, mp2);
996 else
997 return MRFROMLONG(DRR_TARGET);
998
999 case WM_CHAR:
1000 shiftstate = (SHORT1FROMMP(mp1) & (KC_SHIFT | KC_ALT | KC_CTRL));
1001 if (SHORT1FROMMP(mp1) & KC_KEYUP)
1002 return (MRESULT) TRUE;
1003 if (SHORT1FROMMP(mp1) & KC_VIRTUALKEY) {
1004 switch (SHORT2FROMMP(mp2)) {
1005 case VK_DELETE:
1006 if ((shiftstate & KC_CTRL) == KC_CTRL)
1007 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_PERMDELETE, 0), MPVOID);
1008 else if ((shiftstate & KC_SHIFT) == KC_SHIFT)
1009 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_SAVETOCLIP, 0), MPVOID);
1010 else
1011 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DELETE, 0), MPVOID);
1012 break;
1013 }
1014 }
1015 if (shiftstate || fNoSearch)
1016 break;
1017 if (SHORT1FROMMP(mp1) & KC_CHAR) {
1018 ULONG thistime, len;
1019 SEARCHSTRING srch;
1020 PCNRITEM pci;
1021
1022 if (!dcd)
1023 break;
1024 switch (SHORT1FROMMP(mp2)) {
1025 case '\x1b':
1026 case '\r':
1027 case '\n':
1028 dcd->lasttime = 0;
1029 *dcd->szCommonName = 0;
1030 break;
1031 default:
1032 thistime = WinQueryMsgTime(WinQueryAnchorBlock(hwnd));
1033 if (thistime > dcd->lasttime + 1250)
1034 *dcd->szCommonName = 0;
1035 dcd->lasttime = thistime;
1036 if (SHORT1FROMMP(mp2) == ' ' && !dcd->szCommonName)
1037 break;
1038 KbdRetry:
1039 len = strlen(dcd->szCommonName);
1040 if (len >= CCHMAXPATH - 1) {
1041 *dcd->szCommonName = 0;
1042 len = 0;
1043 }
1044 dcd->szCommonName[len] = toupper(SHORT1FROMMP(mp2));
1045 dcd->szCommonName[len + 1] = 0;
1046 memset(&srch, 0, sizeof(SEARCHSTRING));
1047 srch.cb = sizeof(SEARCHSTRING);
1048 srch.pszSearch = dcd->szCommonName;
1049 srch.fsPrefix = TRUE;
1050 srch.fsCaseSensitive = FALSE;
1051 srch.usView = CV_ICON;
1052 pci = WinSendMsg(hwnd, CM_SEARCHSTRING, MPFROMP(&srch),
1053 MPFROMLONG(CMA_FIRST));
1054 if (pci && (INT) pci != -1) {
1055 USHORT attrib = CRA_CURSORED;
1056
1057 /* make found item current item */
1058 if (!stricmp(pci->pszFileName, dcd->szCommonName))
1059 attrib |= CRA_SELECTED;
1060 WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPFROMP(pci),
1061 MPFROM2SHORT(TRUE, attrib));
1062 /* make sure that record shows in viewport */
1063 ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci);
1064 return (MRESULT) TRUE;
1065 }
1066 else {
1067 if (SHORT1FROMMP(mp2) == ' ') {
1068 dcd->szCommonName[len] = 0;
1069 break;
1070 }
1071 *dcd->szCommonName = 0;
1072 dcd->lasttime = 0;
1073 if (len) // retry as first letter if no match
1074
1075 goto KbdRetry;
1076 }
1077 break;
1078 }
1079 }
1080 break;
1081
1082 case WM_MOUSEMOVE:
1083 case WM_BUTTON1UP:
1084 case WM_BUTTON2UP:
1085 case WM_BUTTON3UP:
1086 case WM_CHORD:
1087 shiftstate = (SHORT2FROMMP(mp2) & (KC_SHIFT | KC_ALT | KC_CTRL));
1088 break;
1089
1090 case WM_BUTTON1MOTIONEND:
1091 {
1092 CNRINFO cnri;
1093
1094 memset(&cnri, 0, sizeof(CNRINFO));
1095 cnri.cb = sizeof(CNRINFO);
1096 if (WinSendMsg(hwnd, CM_QUERYCNRINFO, MPFROMP(&cnri),
1097 MPFROMLONG(sizeof(CNRINFO)))) {
1098 if (cnri.flWindowAttr & CV_DETAIL)
1099 PrfWriteProfileData(fmprof, appname, "CollectorCnrSplitBar",
1100 (PVOID) & cnri.xVertSplitbar, sizeof(LONG));
1101 }
1102 }
1103 break;
1104
1105 case WM_PRESPARAMCHANGED:
1106 PresParamChanged(hwnd, "Collector", mp1, mp2);
1107 break;
1108
1109 case UM_COMPARE:
1110 if (dcd && mp1 && mp2) {
1111 COMPARE *cmp;
1112 CHAR *leftdir = (CHAR *)mp1, *rightdir = (CHAR *)mp2;
1113
1114 if (!IsFile(leftdir) && !IsFile(rightdir)) {
1115 cmp = xmallocz(sizeof(COMPARE), pszSrcFile, __LINE__);
1116 if (cmp) {
1117 cmp->size = sizeof(COMPARE);
1118 strcpy(cmp->leftdir, leftdir);
1119 strcpy(cmp->rightdir, rightdir);
1120 cmp->hwndParent = dcd->hwndParent;
1121 cmp->dcd.hwndParent = dcd->hwndParent;
1122 WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, CompareDlgProc,
1123 FM3ModHandle, COMP_FRAME, MPFROMP(cmp));
1124 }
1125 }
1126 }
1127 return 0;
1128
1129 case UM_UPDATERECORDLIST:
1130 if (dcd && mp1)
1131 WinSendMsg(dcd->hwndObject, msg, mp1, mp2);
1132 return 0;
1133
1134 case UM_UPDATERECORD:
1135 if (dcd && mp1) {
1136 CHAR *filename;
1137
1138 filename = mp1;
1139 if (filename)
1140 UpdateCnrRecord(hwnd, filename, TRUE, dcd);
1141 }
1142 return 0;
1143
1144 case WM_SETFOCUS:
1145 /*
1146 * put name of our window on status line
1147 */
1148 if (dcd && hwndStatus && mp2) {
1149 PCNRITEM pci = NULL;
1150
1151 if (fAutoView && hwndMain) {
1152 pci = WinSendMsg(hwnd,
1153 CM_QUERYRECORDEMPHASIS,
1154 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
1155 if (pci && (INT) pci != -1 &&
1156 (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_SLOW)))
1157 WinSendMsg(hwndMain, UM_LOADFILE, MPFROMP(pci->pszFileName), MPVOID);
1158 else
1159 WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
1160 }
1161 if (dcd->amextracted)
1162 WinSetWindowText(hwndStatus2, GetPString(IDS_INSEEKSCANTEXT)); // Say working
1163 WinSendMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
1164 }
1165 break;
1166
1167 case UM_RESCAN:
1168 if (dcd) {
1169 CNRINFO cnri;
1170 CHAR s[CCHMAXPATH + 69], tb[81], tf[81], *p;
1171 PCNRITEM pci = NULL;
1172
1173 memset(&cnri, 0, sizeof(CNRINFO));
1174 cnri.cb = sizeof(CNRINFO);
1175 WinSendMsg(hwnd, CM_QUERYCNRINFO, MPFROMP(&cnri),
1176 MPFROMLONG(sizeof(CNRINFO)));
1177 dcd->totalfiles = cnri.cRecords;
1178 commafmt(tf, sizeof(tf), dcd->totalfiles);
1179 CommaFmtULL(tb, sizeof(tb), dcd->ullTotalBytes, ' ');
1180 sprintf(s, "%s / %s", tf, tb);
1181 WinSetDlgItemText(dcd->hwndClient, DIR_TOTALS, s);
1182
1183 commafmt(tf, sizeof(tf), dcd->selectedfiles);
1184 CommaFmtULL(tb, sizeof(tb), dcd->selectedbytes, ' ');
1185 sprintf(s, "%s / %s", tf, tb);
1186 WinSetDlgItemText(dcd->hwndClient, DIR_SELECTED, s);
1187
1188 if (hwndStatus &&
1189 dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) {
1190 if (hwndMain) {
1191 pci = WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS,
1192 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
1193 if (pci && (INT) pci != -1)
1194 PostMsg(hwndMain, UM_LOADFILE, MPFROMP(pci->pszFileName), MPVOID);
1195 else
1196 PostMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
1197 }
1198 if (!dcd->amextracted) {
1199 if (!fMoreButtons) {
1200 sprintf(s, " %s%s%s%s",
1201 GetPString(IDS_COLLECTORTEXT),
1202 *dcd->mask.szMask || dcd->mask.antiattr ||
1203 dcd->mask.attrFile != ALLATTRS ? " (" : NullStr,
1204 *dcd->mask.szMask ?
1205 dcd->mask.szMask :
1206 dcd->mask.antiattr ||
1207 dcd->mask.attrFile != ALLATTRS ?
1208 GetPString(IDS_ATTRTEXT) : NullStr,
1209 *dcd->mask.szMask || dcd->mask.antiattr ||
1210 dcd->mask.attrFile != ALLATTRS ?
1211 ")" : NullStr);
1212 }
1213 else
1214 strcpy(s, GetPString(IDS_COLLECTORTEXT));
1215 WinSetWindowText(hwndStatus, s);
1216 }
1217 if (!pci)
1218 pci = WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS,
1219 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
1220 if (pci && (INT) pci != -1) {
1221 BOOL fStatus2Used = FALSE;
1222
1223 if (fSplitStatus && hwndStatus2) {
1224 if (pci->attrFile & FILE_DIRECTORY)
1225 p = pci->pszFileName;
1226 else {
1227 p = strrchr(pci->pszFileName, '\\');
1228 if (p) {
1229 if (*(p + 1))
1230 p++;
1231 else
1232 p = pci->pszFileName;
1233 }
1234 else
1235 p = pci->pszFileName;
1236 }
1237 CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
1238 if (!fMoreButtons) {
1239 sprintf(s, " %s %04u/%02u/%02u %02u:%02u:%02u [%s] %s",
1240 tb, pci->date.year, pci->date.month,
1241 pci->date.day, pci->time.hours, pci->time.minutes,
1242 pci->time.seconds, pci->pszDispAttr, p);
1243 }
1244 else {
1245 if (pci->cbFile + pci->easize > 1024)
1246 CommaFmtULL(tf, sizeof(tf), pci->cbFile + pci->easize, 'K');
1247 else
1248 *tf = 0;
1249 sprintf(s, GetPString(IDS_STATUSSIZETEXT),
1250 tb, *tf ? " (" : NullStr, tf, *tf ? ")" : NullStr);
1251 }
1252 WinSetWindowText(hwndStatus2, s);
1253 fStatus2Used = TRUE;
1254 }
1255 if (fMoreButtons) {
1256 WinSetWindowText(hwndName, pci->pszFileName);
1257 sprintf(s, "%04u/%02u/%02u %02u:%02u:%02u",
1258 pci->date.year, pci->date.month,
1259 pci->date.day, pci->time.hours, pci->time.minutes,
1260 pci->time.seconds);
1261 WinSetWindowText(hwndDate, s);
1262 WinSetWindowText(hwndAttr, pci->pszDispAttr);
1263 }
1264 if (dcd->amextracted && hwndStatus2 && !fStatus2Used)
1265 WinSetWindowText(hwndStatus2, GetPString(IDS_INSEEKSCANTEXT)); // Say working
1266 }
1267 else {
1268 if (hwndStatus2) {
1269 if (dcd->amextracted)
1270 WinSetWindowText(hwndStatus2, GetPString(IDS_INSEEKSCANTEXT)); // Say working
1271 else
1272 WinSetWindowText(hwndStatus2, NullStr);
1273 }
1274 if (fMoreButtons) {
1275 WinSetWindowText(hwndName, NullStr);
1276 WinSetWindowText(hwndDate, NullStr);
1277 WinSetWindowText(hwndAttr, NullStr);
1278 }
1279 }
1280 }
1281 }
1282 return 0;
1283
1284 case UM_CONTAINER_FILLED:
1285 DosBeep(1000, 50); // Wake up user?
1286 WinSendMsg(hwnd,
1287 CM_INVALIDATERECORD,
1288 MPVOID, MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION));
1289 disable_menuitem(WinWindowFromID(WinQueryWindow(hwndMain, QW_PARENT),
1290 FID_MENU), IDM_GREP, FALSE);
1291 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
1292 if (dcd) {
1293 dcd->stopflag = 0;
1294 dcd->amextracted = FALSE; // Say not busy
1295 if (dcd->namecanchange) {
1296 if (!PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID))
1297 WinSendMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
1298 }
1299 else
1300 WinSetWindowPos(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT),
1301 QW_PARENT),
1302 HWND_TOP,
1303 0, 0, 0, 0, SWP_SHOW | SWP_RESTORE | SWP_ZORDER);
1304 }
1305 return 0;
1306
1307 case UM_SETUP:
1308 if (dcd) {
1309 if (!dcd->hwndObject) {
1310 /* first time through -- set things up */
1311
1312 CNRINFO cnri;
1313
1314 RestorePresParams(hwnd, "Collector");
1315 LoadDetailsSwitches("Collector", dcd);
1316
1317 dcd->amextracted = FALSE; // Say not busy
1318 dcd->stopflag = 0;
1319 memset(&cnri, 0, sizeof(CNRINFO));
1320 cnri.cb = sizeof(CNRINFO);
1321 WinSendMsg(hwnd, CM_QUERYCNRINFO, MPFROMP(&cnri),
1322 MPFROMLONG(sizeof(CNRINFO)));
1323 cnri.cyLineSpacing = 0;
1324 cnri.cxTreeIndent = 12;
1325
1326 cnri.flWindowAttr &= (~(CV_ICON | CV_TREE | CV_TEXT | CV_DETAIL));
1327 cnri.flWindowAttr |= (CV_NAME | CA_DETAILSVIEWTITLES |
1328 CV_MINI | CV_FLOW);
1329 cnri.pSortRecord = (PVOID) SortCollectorCnr;
1330
1331 size = sizeof(ULONG);
1332 PrfQueryProfileData(fmprof, appname, "CollectorflWindowAttr",
1333 (PVOID) & cnri.flWindowAttr, &size);
1334 size = sizeof(MASK);
1335 if (PrfQueryProfileSize(fmprof, appname, "CollectorFilter", &size) &&
1336 size) {
1337 PrfQueryProfileData(fmprof, appname, "CollectorFilter", &dcd->mask,
1338 &size);
1339 SetMask(NULL, &dcd->mask);
1340 }
1341 else {
1342 dcd->mask.attrFile = (FILE_NORMAL | FILE_READONLY |
1343 FILE_DIRECTORY | FILE_HIDDEN |
1344 FILE_SYSTEM | FILE_ARCHIVED);
1345 dcd->mask.antiattr = 0;
1346 }
1347
1348 *(dcd->mask.prompt) = 0;
1349
1350 cnri.flWindowAttr |= CV_FLOW;
1351 cnri.flWindowAttr &= (~(CA_MIXEDTARGETEMPH | CA_ORDEREDTARGETEMPH));
1352 dcd->flWindowAttr = cnri.flWindowAttr;
1353 WinSendMsg(hwnd, CM_SETCNRINFO, MPFROMP(&cnri),
1354 MPFROMLONG(CMA_FLWINDOWATTR | CMA_LINESPACING |
1355 CMA_CXTREEINDENT | CMA_PSORTRECORD));
1356 SetCnrCols(hwnd, FALSE);
1357 AdjustCnrColsForPref(hwnd, NULL, dcd, FALSE);
1358
1359 /* fix splitbar for collector container */
1360 cnri.xVertSplitbar = DIR_SPLITBAR_OFFSET - 32;
1361 size = sizeof(LONG);
1362 PrfQueryProfileData(fmprof, appname, "CollectorCnrSplitBar",
1363 &cnri.xVertSplitbar, &size);
1364 if (cnri.xVertSplitbar <= 0)
1365 cnri.xVertSplitbar = DIR_SPLITBAR_OFFSET - 32;
1366 WinSendMsg(hwnd, CM_SETCNRINFO, MPFROMP(&cnri),
1367 MPFROMLONG(CMA_XVERTSPLITBAR));
1368
1369 if (_beginthread(MakeObjWin, NULL, 245760, (PVOID)dcd) == -1) {
1370 Runtime_Error(pszSrcFile, __LINE__,
1371 GetPString(IDS_COULDNTSTARTTHREADTEXT));
1372 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
1373 return 0;
1374 }
1375 else
1376 DosSleep(32); // Let object window get started
1377 }
1378 SayFilter(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
1379 DIR_FILTER), &dcd->mask, FALSE);
1380 SaySort(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
1381 DIR_SORT), CollectorsortFlags, FALSE);
1382 SayView(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
1383 DIR_VIEW), dcd->flWindowAttr);
1384 }
1385 else {
1386 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
1387 return 0;
1388 }
1389 return 0;
1390
1391 case WM_MENUEND:
1392 if (dcd) {
1393 HWND hwndMenu = (HWND) mp2;
1394
1395 if (hwndMenu == CollectorCnrMenu || hwndMenu == CollectorFileMenu ||
1396 hwndMenu == CollectorDirMenu) {
1397 MarkAll(hwnd, TRUE, FALSE, TRUE);
1398 if (dcd->cnremphasized) {
1399 WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPVOID,
1400 MPFROM2SHORT(FALSE, CRA_SOURCE));
1401 dcd->cnremphasized = FALSE;
1402 }
1403 }
1404 }
1405 break;
1406
1407 case UM_OPENWINDOWFORME:
1408 if (dcd) {
1409 if (mp1 && !IsFile((CHAR *)mp1))
1410 OpenDirCnr(HWND_DESKTOP, hwndMain, dcd->hwndFrame, FALSE, (PSZ) mp1);
1411 else if (mp1 && IsFile(mp1) == 1)
1412 StartArcCnr(HWND_DESKTOP,
1413 dcd->hwndFrame, (CHAR *)mp1, 4, (ARC_TYPE *) mp2);
1414 }
1415 return 0;
1416
1417 case MM_PORTHOLEINIT:
1418 if (dcd) {
1419 switch (SHORT1FROMMP(mp1)) {
1420 case 0:
1421 case 1:
1422 {
1423 ULONG wmsg;
1424
1425 wmsg = (SHORT1FROMMP(mp1) == 0) ? UM_FILESMENU : UM_VIEWSMENU;
1426 PortholeInit((HWND) WinSendMsg(dcd->hwndClient, wmsg, MPVOID,
1427 MPVOID), mp1, mp2);
1428 }
1429 break;
1430 }
1431 }
1432 break;
1433
1434 case UM_INITMENU:
1435 case WM_INITMENU:
1436 if (dcd) {
1437 switch (SHORT1FROMMP(mp1)) {
1438 case IDM_VIEWSMENU:
1439 SetViewMenu((HWND) mp2, dcd->flWindowAttr);
1440 WinEnableMenuItem((HWND) mp2, IDM_RESELECT,
1441 (dcd->lastselection != NULL));
1442 CopyPresParams((HWND) mp2, hwnd);
1443 break;
1444
1445 case IDM_DETAILSSETUP:
1446 SetDetailsSwitches((HWND) mp2, dcd);
1447 break;
1448
1449 case IDM_COMMANDSMENU:
1450 SetupCommandMenu((HWND) mp2, hwnd);
1451 break;
1452
1453 case IDM_SORTSUBMENU:
1454 SetSortChecks((HWND) mp2, CollectorsortFlags);
1455 break;
1456 }
1457 dcd->hwndLastMenu = (HWND) mp2;
1458 }
1459 if (msg == WM_INITMENU)
1460 break;
1461 return 0;
1462
1463 case UM_COLLECTFROMFILE:
1464 if (mp1) {
1465 if (!dcd) {
1466 xfree(mp1, pszSrcFile, __LINE__);
1467 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
1468 }
1469 else {
1470 if (!PostMsg(dcd->hwndObject, UM_COLLECTFROMFILE, mp1, mp2)) {
1471 Runtime_Error(pszSrcFile, __LINE__, "PostMsg");
1472 xfree(mp1, pszSrcFile, __LINE__);
1473 }
1474 }
1475 }
1476 return 0;
1477
1478 case UM_COMMAND:
1479 if (mp1) {
1480 if (dcd) {
1481 if (!PostMsg(dcd->hwndObject, UM_COMMAND, mp1, mp2)) {
1482 Runtime_Error(pszSrcFile, __LINE__, "PostMsg");
1483 FreeListInfo((LISTINFO *) mp1);
1484 }
1485 else
1486 return (MRESULT) TRUE;
1487 }
1488 else
1489 FreeListInfo((LISTINFO *) mp1);
1490 }
1491 return 0;
1492
1493 case UM_NOTIFY:
1494 if (mp2)
1495 AddNote((CHAR *)mp2);
1496 return 0;
1497
1498 case WM_COMMAND:
1499 DosError(FERR_DISABLEHARDERR);
1500 if (dcd) {
1501 switch (SHORT1FROMMP(mp1)) {
1502 case IDM_SETTARGET:
1503 SetTargetDir(hwnd, FALSE);
1504 break;
1505
1506 case IDM_CONTEXTMENU:
1507 {
1508 PCNRITEM pci;
1509
1510 pci = (PCNRITEM) CurrentRecord(hwnd);
1511 PostMsg(hwnd, WM_CONTROL, MPFROM2SHORT(COLLECTOR_CNR,
1512 CN_CONTEXTMENU),
1513 MPFROMP(pci));
1514 }
1515 break;
1516
1517 case IDM_SHOWALLFILES:
1518 {
1519 PCNRITEM pci;
1520
1521 pci = WinSendMsg(hwnd,
1522 CM_QUERYRECORDEMPHASIS,
1523 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
1524 if (pci && (INT) pci != -1) {
1525 static CHAR dirname[CCHMAXPATH];
1526
1527 strcpy(dirname, pci->pszFileName);
1528 MakeValidDir(dirname);
1529 StartSeeAll(HWND_DESKTOP, FALSE, dirname);
1530 }
1531 }
1532 break;
1533
1534 case IDM_BEGINEDIT:
1535 OpenEdit(hwnd);
1536 break;
1537
1538 case IDM_ENDEDIT:
1539 WinSendMsg(hwnd, CM_CLOSEEDIT, MPVOID, MPVOID);
1540 break;
1541
1542 case IDM_SHOWSELECT:
1543 QuickPopup(hwnd, dcd,
1544 CheckMenu(hwnd, &CollectorCnrMenu, COLLECTORCNR_POPUP),
1545 IDM_SELECTSUBMENU);
1546 break;
1547
1548 case IDM_SHOWSORT:
1549 QuickPopup(hwnd, dcd,
1550 CheckMenu(hwnd, &CollectorCnrMenu, COLLECTORCNR_POPUP),
1551 IDM_SORTSUBMENU);
1552 break;
1553
1554 case IDM_VIEWORARC:
1555 {
1556 SWP swp;
1557 PCNRITEM pci;
1558
1559 pci = (PCNRITEM) WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS,
1560 MPFROMLONG(CMA_FIRST),
1561 MPFROMSHORT(CRA_CURSORED));
1562 if (pci && (INT) pci != -1) {
1563 WinQueryWindowPos(dcd->hwndFrame, &swp);
1564 DefaultViewKeys(hwnd, dcd->hwndFrame, dcd->hwndParent, &swp,
1565 pci->pszFileName);
1566 }
1567 }
1568 break;
1569
1570 case IDM_SEEALL:
1571 StartSeeAll(HWND_DESKTOP, FALSE, NULL);
1572 break;
1573
1574 case IDM_COLLECTSELECT:
1575 {
1576 CHAR filename[CCHMAXPATH], *p, *pp;
1577
1578 strcpy(filename, "*.LST");
1579 size = CCHMAXPATH;
1580 PrfQueryProfileData(fmprof, appname, "SaveToListName",
1581 filename, &size);
1582 pp = strrchr(filename, '\\');
1583 if (!pp)
1584 pp = filename;
1585 p = strrchr(pp, '.');
1586 if (p && *(p + 1) && p > pp + 1) {
1587 if (pp > filename)
1588 pp++;
1589 *pp = '*';
1590 pp++;
1591 if (p > pp)
1592 memmove(pp, p, strlen(p) + 1);
1593 }
1594 if (insert_filename(hwnd, filename, FALSE, FALSE)) {
1595 p = xstrdup(filename, pszSrcFile, __LINE__);
1596 if (p) {
1597 if (!PostMsg(hwnd, UM_COLLECTFROMFILE, MPFROMP(p), MPVOID))
1598 xfree(p, pszSrcFile, __LINE__);
1599 }
1600 }
1601 }
1602 break;
1603
1604 case IDM_COLLECTORVIEWSETTINGS:
1605 if (!ParentIsDesktop(dcd->hwndParent, dcd->hwndParent))
1606 PostMsg(dcd->hwndParent, msg, MPFROMLONG(IDM_COLLECTORVIEWSETTINGS), mp2);
1607 else {
1608 WinDlgBox(HWND_DESKTOP,
1609 hwnd,
1610 CfgDlgProc,
1611 FM3ModHandle,
1612 CFG_FRAME,
1613 MPFROMLONG(IDM_COLLECTORVIEWSETTINGS));
1614 }
1615 break;
1616
1617 case IDM_RESELECT:
1618 SelectList(hwnd, FALSE, FALSE, FALSE, NULL, NULL, dcd->lastselection);
1619 break;
1620
1621 case IDM_HELP:
1622 if (hwndHelp)
1623 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
1624 MPFROM2SHORT(HELP_COLLECT, 0),
1625 MPFROMSHORT(HM_RESOURCEID));
1626 break;
1627
1628 case IDM_SORTNONE:
1629 case IDM_SORTSMARTNAME:
1630 case IDM_SORTNAME:
1631 case IDM_SORTFILENAME:
1632 case IDM_SORTSIZE:
1633 case IDM_SORTEASIZE:
1634 case IDM_SORTFIRST:
1635 case IDM_SORTLAST:
1636 case IDM_SORTLWDATE:
1637 case IDM_SORTLADATE:
1638 case IDM_SORTCRDATE:
1639 case IDM_SORTSUBJECT:
1640 savedSortFlags = CollectorsortFlags;
1641 CollectorsortFlags &= (SORT_REVERSE | SORT_DIRSFIRST | SORT_DIRSLAST);
1642 case IDM_SORTDIRSFIRST:
1643 case IDM_SORTDIRSLAST:
1644 case IDM_SORTREVERSE:
1645 switch (SHORT1FROMMP(mp1)) {
1646 case IDM_SORTSUBJECT:
1647 CollectorsortFlags |= SORT_SUBJECT;
1648 break;
1649 case IDM_SORTNONE:
1650 CollectorsortFlags |= SORT_NOSORT;
1651 break;
1652 case IDM_SORTSMARTNAME:
1653 if (~savedSortFlags & SORT_FILENAME)
1654 CollectorsortFlags |= SORT_FILENAME;
1655 break;
1656 case IDM_SORTFILENAME:
1657 CollectorsortFlags |= SORT_FILENAME;
1658 break;
1659 case IDM_SORTSIZE:
1660 CollectorsortFlags |= SORT_SIZE;
1661 break;
1662 case IDM_SORTEASIZE:
1663 CollectorsortFlags |= SORT_EASIZE;
1664 break;
1665 case IDM_SORTFIRST:
1666 CollectorsortFlags |= SORT_FIRSTEXTENSION;
1667 break;
1668 case IDM_SORTLAST:
1669 CollectorsortFlags |= SORT_LASTEXTENSION;
1670 break;
1671 case IDM_SORTLWDATE:
1672 CollectorsortFlags |= SORT_LWDATE;
1673 break;
1674 case IDM_SORTLADATE:
1675 CollectorsortFlags |= SORT_LADATE;
1676 break;
1677 case IDM_SORTCRDATE:
1678 CollectorsortFlags |= SORT_CRDATE;
1679 break;
1680 case IDM_SORTDIRSFIRST:
1681 if (CollectorsortFlags & SORT_DIRSFIRST)
1682 CollectorsortFlags &= (~SORT_DIRSFIRST);
1683 else {
1684 CollectorsortFlags |= SORT_DIRSFIRST;
1685 CollectorsortFlags &= (~SORT_DIRSLAST);
1686 }
1687 break;
1688 case IDM_SORTDIRSLAST:
1689 if (CollectorsortFlags & SORT_DIRSLAST)
1690 CollectorsortFlags &= (~SORT_DIRSLAST);
1691 else {
1692 CollectorsortFlags |= SORT_DIRSLAST;
1693 CollectorsortFlags &= (~SORT_DIRSFIRST);
1694 }
1695 break;
1696 case IDM_SORTREVERSE:
1697 if (CollectorsortFlags & SORT_REVERSE)
1698 CollectorsortFlags &= (~SORT_REVERSE);
1699 else
1700 CollectorsortFlags |= SORT_REVERSE;
1701 break;
1702 }
1703 PrfWriteProfileData(fmprof, appname, "CollectorSort",
1704 &CollectorsortFlags, sizeof(INT));
1705 WinSendMsg(hwnd, CM_SORTRECORD, MPFROMP(SortCollectorCnr), MPVOID);
1706 SaySort(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
1707 DIR_SORT), CollectorsortFlags, FALSE);
1708 break;
1709
1710 case IDM_COLLECTFROMCLIP:
1711 {
1712 LISTINFO *li;
1713
1714 li = xmallocz(sizeof(LISTINFO), pszSrcFile, __LINE__);
1715 if (li) {
1716 li->list = ListFromClipboard(hwnd);
1717 if (!li->list || !li->list[0])
1718 FreeListInfo(li);
1719 else {
1720 li->type = IDM_COLLECT;
1721 if (!PostMsg(dcd->hwndObject, UM_COLLECT, MPFROMP(li), MPVOID))
1722 FreeListInfo(li);
1723 }
1724 }
1725 }
1726 break;
1727
1728 case IDM_REMOVE:
1729 if (fAutoView && hwndMain)
1730 PostMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
1731 dcd->suspendview = 1;
1732 RemoveAll(hwnd, &dcd->ullTotalBytes, &dcd->totalfiles);
1733 dcd->suspendview = 0;
1734 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
1735 break;
1736
1737 case IDM_CLEARCNR:
1738 {
1739 PCNRITEM pci;
1740
1741 pci = (PCNRITEM) WinSendMsg(hwnd,
1742 CM_QUERYRECORD,
1743 MPVOID,
1744 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
1745 if (pci && (INT) pci != -1) {
1746 RemoveCnrItems(hwnd, NULL, 0, CMA_FREE | CMA_INVALIDATE);
1747 dcd->ullTotalBytes = dcd->selectedbytes = dcd->selectedfiles =
1748 dcd->totalfiles = 0;
1749 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
1750 }
1751 }
1752 break;
1753
1754 case DID_CANCEL:
1755 if (dcd->amextracted)
1756 dcd->stopflag = 1; // Request cancel
1757 break;
1758
1759 case IDM_COLLECTOR:
1760 if (mp2) {
1761 LISTINFO *li;
1762
1763 li = xmallocz(sizeof(LISTINFO), pszSrcFile, __LINE__);
1764 if (li) {
1765 li->list = mp2;
1766 if (!li->list || !li->list[0])
1767 FreeListInfo(li);
1768 else {
1769 li->type = IDM_COLLECT;
1770 if (!PostMsg(dcd->hwndObject, UM_COLLECT, MPFROMP(li), MPVOID))
1771 FreeListInfo(li);
1772 }
1773 }
1774 else
1775 FreeList(mp2);
1776 }
1777 break;
1778
1779 case IDM_UNDELETE:
1780 {
1781 PCNRITEM pci;
1782 CHAR path[CCHMAXPATH];
1783
1784 pci = (PCNRITEM) CurrentRecord(hwnd);
1785 if (pci) {
1786 strcpy(path, pci->pszFileName);
1787 MakeValidDir(path);
1788 WinDlgBox(HWND_DESKTOP, hwnd, UndeleteDlgProc, FM3ModHandle,
1789 UNDEL_FRAME, MPFROMP(path));
1790 }
1791 }
1792 break;
1793
1794 case IDM_GREP:
1795 if (dcd->amextracted) {
1796 saymsg(MB_OK | MB_ICONASTERISK,
1797 hwnd,
1798 GetPString(IDS_WARNINGTEXT),
1799 "Collector busy - please try again later");
1800 }
1801 else {
1802 if (WinDlgBox(HWND_DESKTOP, hwnd, GrepDlgProc,
1803 FM3ModHandle, GREP_FRAME, (PVOID) & hwnd)) {
1804 dcd->amextracted = TRUE; // Say busy scanning
1805 disable_menuitem(WinWindowFromID
1806 (WinQueryWindow(hwndMain, QW_PARENT), FID_MENU),
1807 IDM_GREP, TRUE);
1808 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
1809 }
1810 }
1811 break;
1812
1813 case IDM_RESORT:
1814 WinSendMsg(hwnd, CM_SORTRECORD, MPFROMP(SortCollectorCnr), MPVOID);
1815 break;
1816
1817 case IDM_FILTER:
1818 {
1819 BOOL empty = FALSE;
1820 PCNRITEM pci;
1821 CHAR *p;
1822
1823 if (!*dcd->mask.szMask) {
1824 empty = TRUE;
1825 pci = (PCNRITEM) CurrentRecord(hwnd);
1826 if (pci && !(pci->attrFile & FILE_DIRECTORY)) {
1827 p = strrchr(pci->pszFileName, '\\');
1828 if (p) {
1829 p++;
1830 strcpy(dcd->mask.szMask, p);
1831 }
1832 }
1833 }
1834 *(dcd->mask.prompt) = 0;
1835
1836 if (WinDlgBox(HWND_DESKTOP, hwnd, PickMaskDlgProc,
1837 FM3ModHandle, MSK_FRAME, MPFROMP(&dcd->mask))) {
1838 size = sizeof(MASK);
1839 PrfWriteProfileData(fmprof, appname, "CollectorFilter",
1840 &dcd->mask, size);
1841 dcd->suspendview = 1;
1842 WinSendMsg(hwnd, CM_FILTER, MPFROMP(Filter), MPFROMP(&dcd->mask));
1843 dcd->suspendview = 0;
1844 if (fAutoView && hwndMain) {
1845 pci = WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS,
1846 MPFROMLONG(CMA_FIRST),
1847 MPFROMSHORT(CRA_CURSORED));
1848 if (pci && (INT) pci != -1 &&
1849 (!(driveflags[toupper(*pci->pszFileName) - 'A'] &
1850 DRIVE_SLOW)))
1851 WinSendMsg(hwndMain, UM_LOADFILE, MPFROMP(pci->pszFileName),
1852 MPVOID);
1853 else
1854 WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
1855 }
1856 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
1857 }
1858 else if (empty)
1859 *dcd->mask.szMask = 0;
1860 SayFilter(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
1861 DIR_FILTER), &dcd->mask, FALSE);
1862 }
1863 break;
1864
1865 case IDM_UNHIDEALL:
1866 WinSendMsg(hwnd, CM_FILTER, MPFROMP(Filter), MPFROMP(&dcd->mask));
1867 break;
1868
1869 case IDM_HIDEALL:
1870 if (fAutoView && hwndMain)
1871 PostMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
1872 dcd->suspendview = 1;
1873 HideAll(hwnd);
1874 dcd->suspendview = 0;
1875 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
1876 break;
1877
1878 case IDM_SELECTLIST:
1879 case IDM_SELECTALL:
1880 case IDM_DESELECTALL:
1881 case IDM_SELECTALLFILES:
1882 case IDM_DESELECTALLFILES:
1883 case IDM_SELECTALLDIRS:
1884 case IDM_DESELECTALLDIRS:
1885 case IDM_SELECTMASK:
1886 case IDM_DESELECTMASK:
1887 case IDM_INVERT:
1888 case IDM_SELECTCLIP:
1889 case IDM_DESELECTCLIP:
1890 {
1891 PCNRITEM pci;
1892
1893 pci = (PCNRITEM) CurrentRecord(hwnd);
1894 if ((INT) pci == -1)
1895 pci = NULL;
1896 if (SHORT1FROMMP(mp1) == IDM_HIDEALL) {
1897 if (pci) {
1898 if (!(pci->rc.flRecordAttr & CRA_SELECTED))
1899 pci->rc.flRecordAttr |= CRA_FILTERED;
1900 WinSendMsg(hwnd, CM_INVALIDATERECORD, MPFROMP(&pci),
1901 MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION));
1902 break;
1903 }
1904 }
1905 PostMsg(dcd->hwndObject, UM_SELECT, mp1, MPFROMP(pci));
1906 }
1907 break;
1908
1909 case IDM_RESCAN:
1910 PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPVOID);
1911 break;
1912
1913 case IDM_SHOWLNAMES:
1914 case IDM_SHOWSUBJECT:
1915 case IDM_SHOWEAS:
1916 case IDM_SHOWSIZE:
1917 case IDM_SHOWICON:
1918 case IDM_SHOWLWDATE:
1919 case IDM_SHOWLWTIME:
1920 case IDM_SHOWLADATE:
1921 case IDM_SHOWLATIME:
1922 case IDM_SHOWCRDATE:
1923 case IDM_SHOWCRTIME:
1924 case IDM_SHOWATTR:
1925 AdjustDetailsSwitches(hwnd, dcd->hwndLastMenu,
1926 SHORT1FROMMP(mp1), NULL,
1927 "Collector", dcd, FALSE);
1928 break;
1929
1930 case IDM_ICON:
1931 case IDM_TEXT:
1932 case IDM_DETAILS:
1933 case IDM_NAME:
1934 case IDM_MINIICONS:
1935 case IDM_DETAILSTITLES:
1936 {
1937 CNRINFO cnri;
1938
1939 memset(&cnri, 0, sizeof(CNRINFO));
1940 cnri.cb = sizeof(CNRINFO);
1941 WinSendMsg(hwnd, CM_QUERYCNRINFO, MPFROMP(&cnri),
1942 MPFROMLONG(sizeof(CNRINFO)));
1943 switch (SHORT1FROMMP(mp1)) {
1944 case IDM_ICON:
1945 cnri.flWindowAttr &= (~(CV_ICON | CV_TREE | CV_TEXT |
1946 CV_DETAIL | CV_NAME));
1947 cnri.flWindowAttr |= CV_ICON;
1948 break;
1949 case IDM_NAME:
1950 cnri.flWindowAttr &= (~(CV_ICON | CV_TREE | CV_TEXT |
1951 CV_DETAIL | CV_NAME));
1952 cnri.flWindowAttr |= CV_NAME;
1953 break;
1954 case IDM_TEXT:
1955 cnri.flWindowAttr &= (~(CV_ICON | CV_TREE | CV_TEXT |
1956 CV_DETAIL | CV_NAME));
1957 cnri.flWindowAttr |= CV_TEXT;
1958 break;
1959 case IDM_DETAILS:
1960 cnri.flWindowAttr &= (~(CV_ICON | CV_TREE | CV_TEXT |
1961 CV_DETAIL | CV_NAME));
1962 cnri.flWindowAttr |= CV_DETAIL;
1963 break;
1964 case IDM_MINIICONS:
1965 if (cnri.flWindowAttr & CV_MINI)
1966 cnri.flWindowAttr &= (~CV_MINI);
1967 else
1968 cnri.flWindowAttr |= CV_MINI;
1969 break;
1970 case IDM_DETAILSTITLES:
1971 if (cnri.flWindowAttr & CA_DETAILSVIEWTITLES)
1972 cnri.flWindowAttr &= (~CA_DETAILSVIEWTITLES);
1973 else
1974 cnri.flWindowAttr |= CA_DETAILSVIEWTITLES;
1975 break;
1976 }
1977 cnri.flWindowAttr &= (~(CA_ORDEREDTARGETEMPH | CA_MIXEDTARGETEMPH));
1978 cnri.flWindowAttr |= CV_FLOW;
1979 dcd->flWindowAttr = cnri.flWindowAttr;
1980 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr",
1981 &cnri.flWindowAttr, sizeof(ULONG));
1982 WinSendMsg(hwnd, CM_SETCNRINFO, MPFROMP(&cnri),
1983 MPFROMLONG(CMA_FLWINDOWATTR));
1984 WinSendMsg(hwnd, CM_INVALIDATERECORD, MPVOID,
1985 MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION));
1986 SayView(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
1987 DIR_VIEW), dcd->flWindowAttr);
1988 }
1989 break;
1990
1991 case IDM_SAVETOLIST:
1992 WinDlgBox(HWND_DESKTOP, hwnd, SaveListDlgProc, FM3ModHandle,
1993 SAV_FRAME, MPFROMP(&hwnd));
1994 break;
1995
1996 case IDM_SIZES:
1997 {
1998 PCNRITEM pci;
1999
2000 pci = (PCNRITEM) CurrentRecord(hwnd);
2001 if (pci && (INT) pci != -1)
2002 WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, DirSizeProc, FM3ModHandle,
2003 DSZ_FRAME, pci->pszFileName);
2004 }
2005 break;
2006
2007 case IDM_MKDIR:
2008 {
2009 PCNRITEM pci;
2010
2011 pci = (PCNRITEM) CurrentRecord(hwnd);
2012 PMMkDir(dcd->hwndParent, (pci && (INT) pci != -1) ?
2013 pci->pszFileName : NULL, FALSE);
2014 }
2015 break;
2016
2017 case IDM_DOITYOURSELF:
2018 case IDM_UPDATE:
2019 case IDM_COLLECTFROMFILE:
2020 case IDM_OPENWINDOW:
2021 case IDM_OPENSETTINGS:
2022 case IDM_OPENDEFAULT:
2023 case IDM_OPENICON:
2024 case IDM_OPENDETAILS:
2025 case IDM_OPENTREE:
2026 case IDM_OBJECT:
2027 case IDM_SHADOW:
2028 case IDM_SHADOW2:
2029 case IDM_DELETE:
2030 case IDM_PERMDELETE:
2031 case IDM_PRINT:
2032 case IDM_ATTRS:
2033 case IDM_INFO:
2034 case IDM_COPY:
2035 case IDM_MOVE:
2036 case IDM_WPSCOPY:
2037 case IDM_WPSMOVE:
2038 case IDM_COPYPRESERVE:
2039 case IDM_MOVEPRESERVE:
2040 case IDM_WILDCOPY:
2041 case IDM_WILDMOVE:
2042 case IDM_RENAME:
2043 case IDM_COMPARE:
2044 case IDM_EAS:
2045 case IDM_SUBJECT:
2046 case IDM_VIEW:
2047 case IDM_VIEWTEXT:
2048 case IDM_VIEWBINARY:
2049 case IDM_VIEWARCHIVE:
2050 case IDM_EDIT:
2051 case IDM_EDITTEXT:
2052 case IDM_EDITBINARY:
2053 case IDM_SAVETOCLIP:
2054 case IDM_APPENDTOCLIP:
2055 case IDM_ARCHIVE:
2056 case IDM_ARCHIVEM:
2057 case IDM_EXTRACT:
2058 case IDM_MCIPLAY:
2059 case IDM_UUDECODE:
2060 case IDM_MERGE:
2061 {
2062 LISTINFO *li;
2063 ULONG action = UM_ACTION;
2064
2065 li = xmallocz(sizeof(LISTINFO), pszSrcFile, __LINE__);
2066 if (li) {
2067 li->type = SHORT1FROMMP(mp1);
2068 li->hwnd = hwnd;
2069 li->list = BuildList(hwnd);
2070 if (li->list) {
2071 switch (SHORT1FROMMP(mp1)) {
2072 case IDM_DOITYOURSELF:
2073 case IDM_APPENDTOCLIP:
2074 case IDM_SAVETOCLIP:
2075 case IDM_ARCHIVE:
2076 case IDM_ARCHIVEM:
2077 case IDM_DELETE:
2078 case IDM_PERMDELETE:
2079 case IDM_ATTRS:
2080 case IDM_PRINT:
2081 case IDM_SHADOW:
2082 case IDM_SHADOW2:
2083 case IDM_OBJECT:
2084 case IDM_VIEW:
2085 case IDM_VIEWTEXT:
2086 case IDM_VIEWBINARY:
2087 case IDM_EDIT:
2088 case IDM_EDITTEXT:
2089 case IDM_EDITBINARY:
2090 case IDM_MCIPLAY:
2091 case IDM_UPDATE:
2092 case IDM_INFO:
2093 case IDM_EAS:
2094 action = UM_MASSACTION;
2095 break;
2096 }
2097 if (li->type == IDM_SHADOW || li->type == IDM_OBJECT ||
2098 li->type == IDM_SHADOW2)
2099 *li->targetpath = 0;
2100 if (!PostMsg(dcd->hwndObject, action, MPFROMP(li), MPVOID)) {
2101 Runtime_Error(pszSrcFile, __LINE__, "PostMsg");
2102 FreeListInfo(li);
2103 }
2104 else if (fUnHilite)
2105 UnHilite(hwnd, TRUE, &dcd->lastselection, dcd->ulItemsToUnHilite);
2106 }
2107 else
2108 xfree(li, pszSrcFile, __LINE__);
2109 }
2110 }
2111 break;
2112
2113 default:
2114 if (!cmdloaded)
2115 load_commands();
2116 if (SHORT1FROMMP(mp1) >= IDM_COMMANDSTART &&
2117 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART) {
2118 INT x;
2119
2120 x = SHORT1FROMMP(mp1) - IDM_COMMANDSTART;
2121 if (x >= 0) {
2122 x++;
2123 RunCommand(hwnd, x);
2124 if (fUnHilite)
2125 UnHilite(hwnd, TRUE, &dcd->lastselection, dcd->ulItemsToUnHilite);
2126 }
2127 }
2128 break;
2129 }
2130 }
2131 return 0;
2132
2133 case UM_FIXCNRMLE:
2134 case UM_FIXEDITNAME:
2135 return CommonCnrProc(hwnd, msg, mp1, mp2);
2136
2137 case UM_FILESMENU:
2138 {
2139 PCNRITEM pci;
2140 HWND menuHwnd = (HWND) 0;
2141
2142 pci = (PCNRITEM) CurrentRecord(hwnd);
2143 if (pci && (INT) pci != -1) {
2144 if (pci->attrFile & FILE_DIRECTORY)
2145 menuHwnd = CheckMenu(hwnd, &CollectorDirMenu, COLLECTORDIR_POPUP);
2146 else
2147 menuHwnd = CheckMenu(hwnd, &CollectorFileMenu, COLLECTORFILE_POPUP);
2148 }
2149 return MRFROMLONG(menuHwnd);
2150 }
2151
2152 case WM_CONTROL:
2153 DosError(FERR_DISABLEHARDERR);
2154 if (dcd) {
2155 switch (SHORT2FROMMP(mp1)) {
2156 case CN_CONTEXTMENU:
2157 {
2158 PCNRITEM pci = (PCNRITEM) mp2;
2159
2160 if (pci) {
2161 WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPFROMP(pci),
2162 MPFROM2SHORT(TRUE, CRA_CURSORED));
2163 MarkAll(hwnd, FALSE, FALSE, TRUE);
2164 if (pci->attrFile & FILE_DIRECTORY)
2165 dcd->hwndLastMenu = CheckMenu(hwnd, &CollectorDirMenu,
2166 COLLECTORDIR_POPUP);
2167 else
2168 dcd->hwndLastMenu = CheckMenu(hwnd, &CollectorFileMenu,
2169 COLLECTORFILE_POPUP);
2170 }
2171 else {
2172 dcd->hwndLastMenu = CheckMenu(hwnd, &CollectorCnrMenu,
2173 COLLECTORCNR_POPUP);
2174 if (dcd->hwndLastMenu && !dcd->cnremphasized) {
2175 WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPVOID,
2176 MPFROM2SHORT(TRUE, CRA_SOURCE));
2177 dcd->cnremphasized = TRUE;
2178 }
2179 }
2180 if (dcd->hwndLastMenu) {
2181 if (dcd->hwndLastMenu == CollectorCnrMenu) {
2182 SetViewMenu(dcd->hwndLastMenu, dcd->flWindowAttr);
2183 SetDetailsSwitches(dcd->hwndLastMenu, dcd);
2184 CopyPresParams(dcd->hwndLastMenu, hwnd);
2185 if (dcd->flWindowAttr & CV_MINI)
2186 WinCheckMenuItem(dcd->hwndLastMenu, IDM_MINIICONS, TRUE);
2187 disable_menuitem(dcd->hwndLastMenu, DID_CANCEL,
2188 !dcd->amextracted);
2189 disable_menuitem(dcd->hwndLastMenu, IDM_GREP, dcd->amextracted);
2190 }
2191 if (!PopupMenu(hwnd, hwnd, dcd->hwndLastMenu)) {
2192 if (dcd->cnremphasized) {
2193 WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPVOID,
2194 MPFROM2SHORT(FALSE, CRA_SOURCE));
2195 dcd->cnremphasized = TRUE;
2196 }
2197 MarkAll(hwnd, TRUE, FALSE, TRUE);
2198 }
2199 }
2200 }
2201 break;
2202
2203 case CN_DROPHELP:
2204 if (mp2) {
2205 PDRAGINFO pDInfo;
2206 PCNRITEM pci;
2207 ULONG numitems;
2208 USHORT usOperation;
2209
2210 pci = (PCNRITEM) ((PCNRDRAGINFO) mp2)->pRecord;
2211 pDInfo = ((PCNRDRAGINFO) mp2)->pDragInfo;
2212 if (!DrgAccessDraginfo(pDInfo)) {
2213 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
2214 "DrgAccessDraginfo");
2215 return 0;
2216 }
2217 numitems = DrgQueryDragitemCount(pDInfo);
2218 usOperation = pDInfo->usOperation;
2219 FreeDragInfoData(hwnd, pDInfo);
2220 saymsg(MB_ENTER | MB_ICONASTERISK,
2221 hwnd,
2222 GetPString(IDS_DROPHELPHDRTEXT),
2223 GetPString(IDS_DROPHELPTEXT),
2224 numitems,
2225 &"s"[numitems == 1],
2226 (pci) ? NullStr : GetPString(IDS_NOTEXT),
2227 (pci) ? NullStr : " ",
2228 (pci) ? pci->pszFileName : NullStr,
2229 (pci) ? " " : NullStr,
2230 GetPString((usOperation == DO_COPY) ?
2231 IDS_COPYTEXT :
2232 (usOperation == DO_LINK) ?
2233 IDS_LINKTEXT : IDS_MOVETEXT));
2234 }
2235 return 0;
2236
2237 case CN_DRAGLEAVE:
2238 if (mp2) {
2239 PDRAGINFO pDInfo;
2240
2241 // fixme to know why needed
2242 pDInfo = ((PCNRDRAGINFO) mp2)->pDragInfo;
2243 DrgAccessDraginfo(pDInfo); /* Access DRAGINFO */
2244 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */
2245 }
2246 return 0;
2247
2248 case CN_DRAGAFTER:
2249 case CN_DRAGOVER:
2250 if (mp2) {
2251 PDRAGITEM pDItem; /* Pointer to DRAGITEM */
2252 PDRAGINFO pDInfo; /* Pointer to DRAGINFO */
2253 PCNRITEM pci;
2254 USHORT uso;
2255
2256 pci = (PCNRITEM) ((PCNRDRAGINFO) mp2)->pRecord;
2257 // if(SHORT1FROMMP(mp1) == CN_DRAGAFTER)
2258 // pci = NULL;
2259 pDInfo = ((PCNRDRAGINFO) mp2)->pDragInfo;
2260 if (!DrgAccessDraginfo(pDInfo)) {
2261 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
2262 "DrgAccessDraginfo");
2263 return (MRFROM2SHORT(DOR_NODROP, 0)); /* Drop not valid */
2264 }
2265 if (pci) {
2266 if (pci->rc.flRecordAttr & CRA_SOURCE) {
2267 DrgFreeDraginfo(pDInfo);
2268 return (MRFROM2SHORT(DOR_NODROP, 0));
2269 }
2270 uso = pDInfo->usOperation;
2271 if (uso == DO_DEFAULT)
2272 uso = (fCopyDefault) ? DO_COPY : DO_MOVE;
2273 if (!(pci->attrFile & FILE_DIRECTORY)) {
2274 if (uso != DO_LINK && uso != DO_MOVE && uso != DO_COPY) {
2275 DrgFreeDraginfo(pDInfo);
2276 return MRFROM2SHORT(DOR_NODROP, 0);
2277 }
2278 if (uso != DO_LINK &&
2279 !(driveflags[toupper(*pci->pszFileName) - 'A'] &
2280 DRIVE_NOTWRITEABLE)) {
2281 ARC_TYPE *info = NULL;
2282
2283 if (!fQuickArcFind &&
2284 !(driveflags[toupper(*pci->pszFileName) - 'A'] &
2285 DRIVE_SLOW))
2286 info = find_type(pci->pszFileName, NULL);
2287 else
2288 info = quick_find_type(pci->pszFileName, NULL);
2289 if (!info || ((uso == DO_MOVE && !info->move) ||
2290 (uso == DO_COPY && !info->create))) {
2291 DrgFreeDraginfo(pDInfo);
2292 return MRFROM2SHORT(DOR_NODROP, 0);
2293 }
2294 }
2295 }
2296 }
2297 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */
2298 0); /* Index to DRAGITEM */
2299 if (DrgVerifyRMF(pDItem, /* Check valid rendering */
2300 DRM_OS2FILE, /* mechanisms and data */
2301 NULL)) {
2302 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */
2303 if (pci) {
2304 if (driveflags[toupper(*pci->pszFileName) - 'A'] &
2305 DRIVE_NOTWRITEABLE)
2306 return MRFROM2SHORT(DOR_DROP, DO_LINK);
2307 if (toupper(*pci->pszFileName) < 'C')
2308 return MRFROM2SHORT(DOR_DROP, DO_COPY);
2309 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop */
2310 ((fCopyDefault) ? DO_COPY : DO_MOVE));
2311 }
2312 else
2313 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop */
2314 DO_COPY);
2315 }
2316 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */
2317 }
2318 return (MRFROM2SHORT(DOR_NODROP, 0)); /* Drop not valid */
2319
2320 case CN_INITDRAG:
2321 if (mp2) {
2322 BOOL wasemphasized = FALSE;
2323 PCNRDRAGINIT pcd = (PCNRDRAGINIT) mp2;
2324 PCNRITEM pci;
2325
2326 if (pcd) {
2327 pci = (PCNRITEM) pcd->pRecord;
2328 if (pci) {
2329 if (pci->rc.flRecordAttr & CRA_SELECTED)
2330 wasemphasized = TRUE;
2331 if (IsRoot(pci->pszFileName))
2332 break;
2333 if (hwndStatus2)
2334 WinSetWindowText(hwndStatus2,
2335 GetPString(IDS_DRAGFILEOBJTEXT));
2336 if (DoFileDrag(hwnd, dcd->hwndObject, mp2, NULL, NULL, TRUE)) {
2337 if ((fUnHilite && wasemphasized) || dcd->ulItemsToUnHilite)
2338 UnHilite(hwnd, TRUE, &dcd->lastselection, dcd->ulItemsToUnHilite);
2339 }
2340 if (hwndStatus2)
2341 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
2342 }
2343 }
2344 }
2345 return 0;
2346
2347 case CN_DROP:
2348 if (mp2) {
2349 LISTINFO *li;
2350 ULONG action = UM_ACTION;
2351
2352 li = DoFileDrop(hwnd, NULL, TRUE, mp1, mp2);
2353 CheckPmDrgLimit(((PCNRDRAGINFO)mp2)->pDragInfo);
2354 if (li) {
2355 if (!*li->targetpath) {
2356 li->type = IDM_COLLECT;
2357 action = UM_COLLECT;
2358 }
2359 else {
2360 if (li->list && li->list[0] && IsRoot(li->list[0]))
2361 li->type = DO_LINK;
2362 else if (fDragndropDlg && (!*li->arcname || !li->info)) {
2363 CHECKLIST cl;
2364
2365 memset(&cl, 0, sizeof(cl));
2366 cl.size = sizeof(cl);
2367 cl.flags = li->type;
2368 cl.list = li->list;
2369 cl.cmd = li->type;
2370 cl.prompt = li->targetpath;
2371 li->type = WinDlgBox(HWND_DESKTOP, dcd->hwndParent,
2372 DropListProc, FM3ModHandle,
2373 DND_FRAME, MPFROMP(&cl));
2374 if (li->type == DID_ERROR)
2375 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__,
2376 "Drag & Drop Dialog");
2377 if (!li->type) {
2378 FreeListInfo(li);
2379 return 0;
2380 }
2381 li->list = cl.list;
2382 if (!li->list || !li->list[0]) {
2383 FreeListInfo(li);
2384 return 0;
2385 }
2386 }
2387 switch (li->type) {
2388 case DND_LAUNCH:
2389 strcat(li->targetpath, " %a");
2390 ExecOnList(dcd->hwndParent, li->targetpath,
2391 PROMPT | WINDOWED, NULL, li->list, NULL,
2392 pszSrcFile, __LINE__);
2393 FreeList(li->list);
2394 li->list = NULL;
2395 break;
2396 case DO_LINK:
2397 if (fLinkSetsIcon) {
2398 li->type = IDM_SETICON;
2399 action = UM_MASSACTION;
2400 }
2401 else
2402 li->type = IDM_COMPARE;
2403 break;
2404 case DND_EXTRACT:
2405 if (*li->targetpath && !IsFile(li->targetpath))
2406 li->type = IDM_EXTRACT;
2407 break;
2408 case DND_MOVE:
2409 li->type = IDM_MOVE;
2410 if (*li->targetpath && IsFile(li->targetpath) == 1) {
2411 action = UM_MASSACTION;
2412 li->type = IDM_ARCHIVEM;
2413 }
2414 break;
2415 case DND_WILDMOVE:
2416 li->type = IDM_WILDMOVE;
2417 if (*li->targetpath && IsFile(li->targetpath) == 1) {
2418 action = UM_MASSACTION;
2419 li->type = IDM_ARCHIVEM;
2420 }
2421 break;
2422 case DND_OBJECT:
2423 li->type = IDM_OBJECT;
2424 action = UM_MASSACTION;
2425 break;
2426 case DND_SHADOW:
2427 li->type = IDM_SHADOW;
2428 action = UM_MASSACTION;
2429 break;
2430 case DND_COMPARE:
2431 li->type = IDM_COMPARE;
2432 break;
2433 case DND_SETICON:
2434 action = UM_MASSACTION;
2435 li->type = IDM_SETICON;
2436 break;
2437 case DND_WILDCOPY:
2438 li->type = IDM_WILDCOPY;
2439 if (*li->targetpath && IsFile(li->targetpath) == 1) {
2440 action = UM_MASSACTION;
2441 li->type = IDM_ARCHIVE;
2442 }
2443 break;
2444 case DND_COPY:
2445 li->type = IDM_COPY;
2446 if (*li->targetpath && IsFile(li->targetpath) == 1) {
2447 action = UM_MASSACTION;
2448 li->type = IDM_ARCHIVE;
2449 }
2450 break;
2451 default:
2452 if (*li->arcname && li->info) {
2453 action = UM_MASSACTION;
2454 li->type =
2455 (li->type ==
2456 DO_MOVE) ? IDM_FAKEEXTRACTM : IDM_FAKEEXTRACT;
2457 }
2458 else if (*li->targetpath && IsFile(li->targetpath) == 1) {
2459 action = UM_MASSACTION;
2460 li->type =
2461 (li->type == DO_MOVE) ? IDM_ARCHIVEM : IDM_ARCHIVE;
2462 }
2463 else
2464 li->type = (li->type == DO_MOVE) ? IDM_MOVE : IDM_COPY;
2465 break;
2466 }
2467 }
2468 if (!li->list || !li->list[0])
2469 FreeListInfo(li);
2470 else if (!PostMsg(dcd->hwndObject, action, MPFROMP(li), MPVOID))
2471 FreeListInfo(li);
2472 else {
2473 USHORT usop = 0;
2474
2475 switch (li->type) {
2476 case IDM_COPY:
2477 case IDM_WILDCOPY:
2478 usop = DO_COPY;
2479 break;
2480 case IDM_MOVE:
2481 case IDM_WILDMOVE:
2482 case IDM_ARCHIVEM:
2483 usop = DO_MOVE;
2484 break;
2485 }
2486 if (usop)
2487 return MRFROM2SHORT(DOR_DROP, usop);
2488 }
2489 }
2490 }
2491 return 0;
2492
2493 case CN_BEGINEDIT:
2494 case CN_REALLOCPSZ:
2495 case CN_ENDEDIT:
2496 {
2497 MRESULT mre;
2498
2499 mre = CnrDirectEdit(hwnd, msg, mp1, mp2);
2500 if (mre != (MRESULT) - 1)
2501 return mre;
2502 }
2503 break;
2504
2505 case CN_EMPHASIS:
2506 if (mp2) {
2507 PNOTIFYRECORDEMPHASIS pre = mp2;
2508 PCNRITEM pci;
2509 CHAR s[CCHMAXPATH + 91], tb[81], tf[81], *p;
2510
2511 pci = (PCNRITEM) ((pre) ? pre->pRecord : NULL);
2512 if (!pci) {
2513 if (hwndStatus2)
2514 WinSetWindowText(hwndStatus2, NullStr);
2515 if (fMoreButtons) {
2516 WinSetWindowText(hwndName, NullStr);
2517 WinSetWindowText(hwndDate, NullStr);
2518 WinSetWindowText(hwndAttr, NullStr);
2519 }
2520 if (hwndMain)
2521 WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
2522 break;
2523 }
2524 if (pre->fEmphasisMask & CRA_SELECTED) {
2525 if (pci->rc.flRecordAttr & CRA_SELECTED) {
2526 dcd->selectedbytes += (pci->cbFile + pci->easize);
2527 dcd->selectedfiles++;
2528 }
2529 else if (dcd->selectedfiles) {
2530 dcd->selectedbytes -= (pci->cbFile + pci->easize);
2531 dcd->selectedfiles--;
2532 }
2533 if (!dcd->suspendview) {
2534 commafmt(tf, sizeof(tf), dcd->selectedfiles);
2535 CommaFmtULL(tb, sizeof(tb), dcd->selectedbytes, ' ');
2536 sprintf(s, "%s / %s", tf, tb);
2537 WinSetDlgItemText(dcd->hwndClient, DIR_SELECTED, s);
2538 }
2539 }
2540 if (!dcd->suspendview &&
2541 WinQueryActiveWindow(dcd->hwndParent) == dcd->hwndFrame) {
2542 if (pre->fEmphasisMask & CRA_CURSORED) {
2543 if (pci->rc.flRecordAttr & CRA_CURSORED) {
2544 if (fSplitStatus && hwndStatus2) {
2545 if (pci->attrFile & FILE_DIRECTORY)
2546 p = pci->pszFileName;
2547 else {
2548 p = strrchr(pci->pszFileName, '\\');
2549 if (p) {
2550 if (*(p + 1))
2551 p++;
2552 else
2553 p = pci->pszFileName;
2554 }
2555 else
2556 p = pci->pszFileName;
2557 }
2558 CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
2559 if (!fMoreButtons)
2560 sprintf(s, " %s %04u/%02u/%02u %02u:%02u:%02u [%s] %s",
2561 tb, pci->date.year,
2562 pci->date.month, pci->date.day, pci->time.hours,
2563 pci->time.minutes, pci->time.seconds,
2564 pci->pszDispAttr, p);
2565 else {
2566 if (pci->cbFile + pci->easize > 1024)
2567 CommaFmtULL(tf, sizeof(tf), pci->cbFile + pci->easize,
2568 ' ');
2569 else
2570 *tf = 0;
2571 sprintf(s, GetPString(IDS_STATUSSIZETEXT),
2572 tb,
2573 *tf ? " (" : NullStr, tf, *tf ? ")" : NullStr);
2574 }
2575 WinSetWindowText(hwndStatus2, s);
2576 }
2577 if (fMoreButtons) {
2578 WinSetWindowText(hwndName, pci->pszFileName);
2579 sprintf(s, "%04u/%02u/%02u %02u:%02u:%02u",
2580 pci->date.year, pci->date.month,
2581 pci->date.day, pci->time.hours, pci->time.minutes,
2582 pci->time.seconds);
2583 WinSetWindowText(hwndDate, s);
2584 WinSetWindowText(hwndAttr, pci->pszDispAttr);
2585 }
2586 }
2587 }
2588 }
2589 if (!dcd->suspendview && hwndMain &&
2590 (pre->fEmphasisMask & CRA_CURSORED) &&
2591 (pci->rc.flRecordAttr & CRA_CURSORED) &&
2592 WinQueryActiveWindow(dcd->hwndParent) == dcd->hwndFrame)
2593 WinSendMsg(hwndMain, UM_LOADFILE,
2594 MPFROMP(((fComments
2595 || (pci->attrFile & FILE_DIRECTORY) ==
2596 0) ? pci->pszFileName : NULL)), MPVOID);
2597 }
2598 break;
2599
2600 case CN_ENTER:
2601 if (mp2) {
2602 PCNRITEM pci = (PCNRITEM) ((PNOTIFYRECORDENTER) mp2)->pRecord;
2603 FILEFINDBUF3 ffb;
2604 HDIR hDir = HDIR_CREATE;
2605 ULONG nm = 1;
2606 APIRET status = 0;
2607
2608 SetShiftState();
2609 if (pci) {
2610 if (pci->rc.flRecordAttr & CRA_INUSE)
2611 break;
2612 DosError(FERR_DISABLEHARDERR);
2613 status = DosFindFirst(pci->pszFileName, &hDir,
2614 FILE_NORMAL | FILE_DIRECTORY |
2615 FILE_ARCHIVED | FILE_READONLY |
2616 FILE_HIDDEN | FILE_SYSTEM,
2617 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
2618 priority_bumped();
2619 if (!status) {
2620 DosFindClose(hDir);
2621 if (ffb.attrFile & FILE_DIRECTORY) {
2622 if ((shiftstate & (KC_CTRL | KC_ALT)) == (KC_CTRL | KC_ALT))
2623 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_SHOWALLFILES, 0),
2624 MPVOID);
2625 else if ((shiftstate & (KC_CTRL | KC_SHIFT)) ==
2626 (KC_CTRL | KC_SHIFT))
2627 OpenObject(pci->pszFileName, Settings, dcd->hwndFrame);
2628 else if (shiftstate & KC_CTRL)
2629 OpenObject(pci->pszFileName, Default, dcd->hwndFrame);
2630 else
2631 OpenDirCnr(HWND_DESKTOP,
2632 hwndMain,
2633 dcd->hwndFrame, FALSE, pci->pszFileName);
2634 }
2635 else {
2636 SWP swp;
2637
2638 WinSendMsg(hwnd,
2639 CM_SETRECORDEMPHASIS,
2640 MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_INUSE));
2641 WinQueryWindowPos(dcd->hwndFrame, &swp);
2642 DefaultViewKeys(hwnd,
2643 dcd->hwndFrame,
2644 dcd->hwndParent, &swp, pci->pszFileName);
2645 WinSendMsg(hwnd,
2646 CM_SETRECORDEMPHASIS,
2647 MPFROMP(pci),
2648 MPFROM2SHORT(FALSE, CRA_INUSE |
2649 ((fUnHilite) ? CRA_SELECTED : 0)));
2650 }
2651 }
2652 else
2653 RemoveCnrItems(hwnd, pci, 1, CMA_FREE | CMA_INVALIDATE | CMA_ERASE);
2654 }
2655 }
2656 break;
2657 }
2658 }
2659 return 0;
2660
2661 case UM_LOADFILE:
2662 if (dcd && mp2) {
2663 HWND ret;
2664
2665 ret = StartMLEEditor(dcd->hwndParent,
2666 (INT) mp1, (CHAR *)mp2, dcd->hwndFrame);
2667 xfree((CHAR *)mp2, pszSrcFile, __LINE__);
2668 return MRFROMLONG(ret);
2669 }
2670 return 0;
2671
2672 case UM_CLOSE:
2673 WinDestroyWindow(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT),
2674 QW_PARENT));
2675 return 0;
2676
2677 case UM_FOLDUP:
2678 if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID))
2679 DosExit(EXIT_PROCESS, 1);
2680 return 0;
2681
2682 case WM_CLOSE:
2683 if (dcd) {
2684 dcd->namecanchange = TRUE;
2685 dcd->stopflag = 1;
2686 if (dcd->amextracted)
2687 return 0; // Can not close yet
2688 }
2689 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID);
2690 if (dcd) {
2691 if (!dcd->dontclose && ParentIsDesktop(hwnd, dcd->hwndParent))
2692 PostMsg(hwnd, UM_FOLDUP, MPVOID, MPVOID);
2693 if (dcd->hwndObject) {
2694 DosSleep(32); // Allow UM_FOLDUP to process
2695 if (!PostMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID))
2696 WinSendMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID);
2697 }
2698 }
2699 else
2700 WinSendMsg(hwnd, UM_CLOSE, MPVOID, MPVOID);
2701 return 0;
2702
2703 case WM_DESTROY:
2704 if (CollectorDirMenu)
2705 WinDestroyWindow(CollectorDirMenu);
2706 if (CollectorFileMenu)
2707 WinDestroyWindow(CollectorFileMenu);
2708 if (CollectorCnrMenu)
2709 WinDestroyWindow(CollectorCnrMenu);
2710 CollectorCnrMenu = CollectorFileMenu = CollectorDirMenu = (HWND) 0;
2711 Collector = (HWND) 0;
2712 EmptyCnr(hwnd);
2713 break;
2714 }
2715 if (dcd && dcd->oldproc){
2716 return dcd->oldproc(hwnd, msg, mp1, mp2);
2717 }
2718 else
2719 return PFNWPCnr(hwnd, msg, mp1, mp2);
2720}
2721
2722MRESULT EXPENTRY CollectorMenuProc(HWND hwnd, ULONG msg, MPARAM mp1,
2723 MPARAM mp2)
2724{
2725 PFNWP oldMenuProc = WinQueryWindowPtr(hwnd, QWL_USER);
2726 static short sLastMenuitem;
2727
2728 switch (msg) {
2729 case WM_MOUSEMOVE: {
2730 if (fOtherHelp) {
2731 RECTL rectl;
2732 SHORT i, sCurrentMenuitem;
2733 SHORT MenuItems = 5;
2734 SHORT asMenuIDs[5] = {IDM_GREP,
2735 IDM_SEEALL,
2736 IDM_CLEARCNR,
2737 IDM_REMOVE,
2738 0};
2739 char *szHelpString = NULL;
2740
2741
2742 for (i=0; i<MenuItems; i++) {
2743 sCurrentMenuitem = asMenuIDs[i];
2744 oldMenuProc(hwnd,MM_QUERYITEMRECT,
2745 MPFROM2SHORT(asMenuIDs[i], FALSE),
2746 &rectl);
2747
2748 if (MOUSEMSG(&msg)->x > rectl.xLeft &&
2749 MOUSEMSG(&msg)->x < rectl.xRight &&
2750 MOUSEMSG(&msg)->y > rectl.yBottom &&
2751 MOUSEMSG(&msg)->y < rectl.yTop)
2752 break;
2753 } // for
2754
2755
2756 switch (sCurrentMenuitem) {
2757 case 0:
2758 break;
2759 case IDM_GREP:
2760 szHelpString = GetPString(IDS_COLMENUSEEKSCANHELP);
2761 break;
2762 case IDM_SEEALL:
2763 szHelpString = GetPString(IDS_COLMENUSEEALLHELP);
2764 break;
2765 case IDM_CLEARCNR:
2766 szHelpString = GetPString(IDS_COLMENUCLEARCNRHELP);
2767 break;
2768 case IDM_REMOVE:
2769 szHelpString = GetPString(IDS_COLMENUREMOVECNRHELP);
2770 break;
2771 default:
2772 break;
2773 }
2774
2775 if (sLastMenuitem != sCurrentMenuitem && szHelpString) {
2776 sLastMenuitem = sCurrentMenuitem;
2777 MakeBubble(hwnd, TRUE, szHelpString);
2778 }
2779 else if (hwndBubble && !sCurrentMenuitem){
2780 sLastMenuitem = sCurrentMenuitem;
2781 WinDestroyWindow(hwndBubble);
2782 }
2783 }
2784 }
2785 }
2786 return oldMenuProc(hwnd, msg, mp1, mp2);
2787}
2788
2789HWND StartCollector(HWND hwndParent, INT flags)
2790{
2791 HWND hwndFrame = (HWND) 0;
2792 HWND hwndClient;
2793 ULONG FrameFlags = FCF_TITLEBAR | FCF_SYSMENU |
2794 FCF_SIZEBORDER | FCF_MINMAX | FCF_ICON | FCF_NOBYTEALIGN | FCF_ACCELTABLE;
2795 USHORT id;
2796 DIRCNRDATA *dcd;
2797
2798 static USHORT idinc = 0;
2799
2800 if (ParentIsDesktop(hwndParent, hwndParent))
2801 FrameFlags |= (FCF_TASKLIST | FCF_SHELLPOSITION | FCF_MENU);
2802 if (Collector) {
2803 WinSetWindowPos(WinQueryWindow(WinQueryWindow(Collector,
2804 QW_PARENT),
2805 QW_PARENT),
2806 HWND_TOP, 0, 0, 0, 0, SWP_SHOW | SWP_RESTORE);
2807 return WinQueryWindow(WinQueryWindow(Collector, QW_PARENT), QW_PARENT);
2808 }
2809 hwndFrame = WinCreateStdWindow(hwndParent,
2810 WS_VISIBLE,
2811 &FrameFlags,
2812 WC_COLLECTOR,
2813 NULL,
2814 WS_VISIBLE | fwsAnimate,
2815 FM3ModHandle, COLLECTOR_FRAME, &hwndClient);
2816 if (hwndFrame && hwndClient) {
2817 id = COLLECTOR_FRAME + idinc++;
2818 WinSetWindowUShort(hwndFrame, QWS_ID, id);
2819# ifdef FORTIFY
2820 Fortify_EnterScope();
2821# endif
2822 dcd = xmallocz(sizeof(DIRCNRDATA), pszSrcFile, __LINE__);
2823 if (!dcd) {
2824 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
2825 PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
2826 hwndFrame = (HWND) 0;
2827 }
2828 else {
2829 dcd->size = sizeof(DIRCNRDATA);
2830 dcd->id = id;
2831 dcd->type = COLLECTOR_FRAME;
2832 dcd->hwndParent = (hwndParent) ? hwndParent : HWND_DESKTOP;
2833 dcd->hwndFrame = hwndFrame;
2834 dcd->hwndClient = hwndClient;
2835 if (flags & 4)
2836 dcd->dontclose = TRUE;
2837 {
2838 PFNWP oldproc;
2839
2840 oldproc = WinSubclassWindow(hwndFrame, (PFNWP) CollectorFrameWndProc);
2841 WinSetWindowPtr(hwndFrame, QWL_USER, (PVOID) oldproc);
2842 }
2843 dcd->hwndCnr = WinCreateWindow(hwndClient,
2844 WC_CONTAINER,
2845 NULL,
2846 CCS_AUTOPOSITION | CCS_MINIICONS |
2847 CCS_MINIRECORDCORE | ulCnrType |
2848 WS_VISIBLE,
2849 0,
2850 0,
2851 0,
2852 0,
2853 hwndClient,
2854 HWND_TOP,
2855 (ULONG) COLLECTOR_CNR, NULL, NULL);
2856 if (!dcd->hwndCnr) {
2857 Win_Error2(hwndClient, hwndClient, pszSrcFile, __LINE__,
2858 IDS_WINCREATEWINDOW);
2859 PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
2860 xfree(dcd, pszSrcFile, __LINE__);
2861# ifdef FORTIFY
2862 Fortify_LeaveScope();
2863# endif
2864 hwndFrame = (HWND) 0;
2865 }
2866 else {
2867 Collector = dcd->hwndCnr;
2868 WinSetWindowPtr(dcd->hwndCnr, QWL_USER, (PVOID) dcd);
2869 WinSetWindowText(hwndFrame, GetPString(IDS_COLLECTORTITLETEXT));
2870 if (FrameFlags & FCF_MENU) {
2871 PFNWP oldmenuproc;
2872 HWND hwndMenu = WinWindowFromID(hwndFrame, FID_MENU);
2873
2874 oldmenuproc = WinSubclassWindow(hwndMenu, (PFNWP) CollectorMenuProc);
2875 WinSetWindowPtr(hwndMenu, QWL_USER, (PVOID) oldmenuproc);
2876 if (!fToolbar) {
2877 if (hwndMenu) {
2878
2879 WinSendMsg(hwndMenu,
2880 MM_DELETEITEM,
2881 MPFROM2SHORT(IDM_SEEALL, FALSE), MPVOID);
2882 WinSendMsg(hwndMenu,
2883 MM_DELETEITEM,
2884 MPFROM2SHORT(IDM_GREP, FALSE), MPVOID);
2885 WinSendMsg(hwndMenu,
2886 MM_DELETEITEM,
2887 MPFROM2SHORT(IDM_CLEARCNR, FALSE), MPVOID);
2888 WinSendMsg(hwndMenu,
2889 MM_DELETEITEM,
2890 MPFROM2SHORT(IDM_REMOVE, FALSE), MPVOID);
2891 }
2892 }
2893 }
2894 dcd->oldproc = WinSubclassWindow(dcd->hwndCnr,
2895 (PFNWP) CollectorCnrWndProc);
2896 {
2897 USHORT ids[] = { DIR_TOTALS,
2898 DIR_SELECTED,
2899 DIR_VIEW,
2900 DIR_SORT,
2901 DIR_FILTER,
2902 0
2903 };
2904
2905 CommonCreateTextChildren(dcd->hwndClient,
2906 WC_COLSTATUS, ids);
2907 }
2908 if (FrameFlags & FCF_SHELLPOSITION)
2909 PostMsg(hwndClient, UM_SIZE, MPVOID, MPVOID);
2910 if (!PostMsg(dcd->hwndCnr, UM_SETUP, MPVOID, MPVOID))
2911 WinSendMsg(dcd->hwndCnr, UM_SETUP, MPVOID, MPVOID);
2912 }
2913 }
2914 }
2915 return hwndFrame;
2916}
2917
2918#pragma alloc_text(COLLECTOR,CollectorCnrWndProc,CollectorObjWndProc)
2919#pragma alloc_text(COLLECTOR,CollectorClientWndProc,CollectorTextProc)
2920#pragma alloc_text(COLLECTOR,CollectorFrameWndProc)
2921#pragma alloc_text(STARTUP,StartCollector)
Note: See TracBrowser for help on using the repository browser.