source: trunk/dll/collect.c@ 551

Last change on this file since 551 was 551, checked in by Gregg Young, 19 years ago

Indentation cleanup

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