source: trunk/dll/worker.c@ 1449

Last change on this file since 1449 was 1449, checked in by Gregg Young, 16 years ago

Fix failure of containers to update when Tree container isn't open in FM2 lite; get DosGetMessage to work in HIMEM builds (Ticket 389, 390)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 51.1 KB
Line 
1
2/***********************************************************************
3
4 $Id: worker.c 1449 2009-07-26 20:00:52Z gyoung $
5
6 Worker thread
7
8 Copyright (c) 1993-98 M. Kimes
9 Copyright (c) 2001, 2009 Steven H. Levine
10
11 16 Oct 02 SHL Comments
12 18 Oct 02 SHL MassAction:Archive - force extension so file found
13 06 Jun 05 SHL Indent -i2
14 06 Jun 05 SHL Rework Action for VAC3.65 compat
15 27 Jul 05 SHL IDM_DOITYOURSELF - avoid need to strip in ExecOnList
16 22 Jul 06 SHL Comments
17 22 Jul 06 SHL Check more run time errors
18 03 Nov 06 SHL Renames
19 03 Nov 06 SHL Count thread usage
20 21 Apr 07 GKY Find FM2Utils by path or utils directory
21 16 Jun 07 SHL Update for OpenWatcom
22 06 Aug 07 GKY Reduce DosSleep times (ticket 148)
23 07 Aug 07 SHL Use BldQuotedFileName
24 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
25 26 Aug 07 SHL Revert to DosSleep(0)
26 29 Feb 08 GKY Refactor global command line variables to notebook.h
27 22 Jun 08 GKY Made Felete move to xworkplace trash can on systems that have it
28 16 JUL 08 GKY Use TMP directory for temp files
29 20 Jul 08 GKY Add save/append filename to clipboard.
30 02 Aug 08 GKY Limit use of "trash can" to local writable fixed drives or to trash can supported
31 drives list if it exists. Fix ability to deselect use of trash can.
32 01 Sep 08 GKY Add code to retry on Netdrives "pipe error"
33 04 Dec 08 GKY Add a DosSleep to allow file extract to complete before rescan
34 04 Dec 08 GKY Add mutex semaphore and disable fSyncUpdates for file deletes to prevent the creation
35 on dead CNRITEMS.
36 10 Dec 08 SHL Integrate exception handler support
37 25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
38 25 Dec 08 GKY Add DRIVE_RSCANNED flag to monitor for the first recursive drive scan per session
39 to prevent duplicate directory names in tree following a copy before initial scan.
40 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
41 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used)
42 08 Mar 09 GKY Additional strings move to PCSZs
43 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
44 26 Jul 09 GKY Fix failure of containers to update when Tree container isn't open in FM2 lite
45
46***********************************************************************/
47
48#include <stdlib.h>
49#include <string.h>
50#include <ctype.h>
51#include <share.h>
52#include <process.h> // _beginthread // 10 Dec 08 SHL
53#include <time.h>
54
55#define INCL_DOS
56#define INCL_DOSERRORS
57// #define INCL_WINPROGRAMLIST // 13 Jul 09 SHL dropped
58// #define INCL_WINHELP // 13 Jul 09 SHL dropped
59#define INCL_LONGLONG
60#define INCL_WINPOINTERS // WinSetFileIcon
61// #define INCL_WINWORKPLACE // 13 Jul 09 SHL dropped
62#define INCL_WINSHELLDATA // PrfQueryProfileData
63#define INCL_WINTIMER // WinStarTimer
64#define INCL_WININPUT // WinQueryFocus
65
66#include "fm3dll.h"
67#include "fm3dll2.h" // #define's for UM_*, control id's, etc.
68#include "mainwnd2.h" // Data declaration(s)
69#include "arccnrs.h" // Data declaration(s)
70#include "init.h" // Data declaration(s)
71#include "defview.h" // Data declaration(s)
72#include "newview.h" // Data declarations
73#include "fm3dlg.h"
74#include "fm3str.h"
75#include "comp.h" // FCOMPARE
76#include "pathutil.h" // BldQuotedFileName
77#include "makelist.h" // AddToList
78#include "errutil.h" // Dos_Error...
79#include "strutil.h" // GetPString
80#include "notebook.h" // External viewers
81#include "worker.h" // Action
82#include "notify.h" // AddNote
83#include "copyf.h" // AdjustWildcardName, make_deleteable
84#include "attribs.h" // AttrListDlgProc
85#include "chklist.h" // CheckListProc
86#include "info.h" // DrvInfoProc
87#include "extract.h" // ExtractDlgProc
88#include "info.h" // FileInfoProc
89#include "valid.h" // GetDesktopName, IsNewer
90#include "saveclip.h" // ListToClipboardHab
91#include "shadow.h" // MakeShadows
92#include "mkdir.h" // MassMkdir
93#include "uudecode.h" // MergeDlgProc
94#include "objcnr.h" // ObjCnrDlgProc
95#include "printer.h" // PrintDlgProc, PrintListThread
96#include "rename.h" // RenameProc
97#include "srchpath.h" // RunFM2Util
98#include "mainwnd.h" // TopWindowName
99#include "uudecode.h" // UUD
100#include "walkem.h" // WalkCopyDlgProc, WalkDlgProc, WalkMoveDlgProc
101#include "archive.h" // ArchiveDlgProc
102#include "misc.h" // Broadcast
103#include "common.h" // DecrThreadUsage, IncrThreadUsage
104#include "eas.h" // DisplayEAsProc
105#include "systemf.h" // ExecOnList
106#include "avl.h" // SBoxDlgProc
107#include "subj.h" // Subject
108#include "grep.h" // hwndStatus
109#include "stristr.h" // stristr
110#include "wrappers.h" // xfopen
111#include "fortify.h"
112#include "excputil.h" // 06 May 08 SHL added
113
114// Data definitions
115#pragma data_seg(GLOBAL2)
116FILE *LogFileHandle;
117
118#pragma data_seg(DATA2)
119
120static PSZ pszSrcFile = __FILE__;
121
122#ifdef UNDO
123
124static VOID LINFO undo;
125
126VOID FreeUndo(VOID)
127{
128 if (undo->list)
129 FreeList(undo->list);
130 memset(&undo, 0, sizeof(undo));
131}
132
133VOID Undo(HWND hwndCnr, HWND hwndFrame, HWND hwndClient, HWND hwndParent)
134{
135 LISTINFO *li;
136 WORKER *wk;
137
138 if (undo->type && undo->list && undo->list[0]) {
139 switch (undo->type) {
140 case IDM_MOVE:
141 case IDM_COPY:
142 case IDM_EXTRACT:
143 {
144# ifdef FORTIFY
145 Fortify_EnterScope();
146# endif
147 li = xmallocz(sizeof(LISTINFO), pszSrcFile, __LINE__);
148 if (li) {
149 wk = xmallocz(sizeof(WORKER), pszSrcFile, __LINE__);
150 if (wk) {
151 wk->size = sizeof(WORKER);
152 wk->hwndCnr = hwndCnr;
153 wk->hwndParent = hwndParent;
154 wk->hwndFrame = hwndFrame;
155 wk->hwndClient = hwndClient;
156 wk->li = li;
157 *wk->li = *undo;
158 switch (undo->type) {
159 case IDM_COPY:
160 case IDM_EXTRACT:
161 li->type = IDM_PERMDELETE;
162 break;
163 }
164 if (xbeginthread(MassAction,
165 122880,
166 wk,
167 pszSrcFile,
168 __LINE__) == -1)
169 {
170 FreeListInfo(wk->li);
171 free(wk);
172# ifdef FORTIFY
173 Fortify_LeaveScope();
174# endif
175 }
176 }
177 else
178 FreeListInfo(li);
179 }
180 }
181 break;
182 } // switch
183 }
184 FreeUndo();
185# ifdef FORTIFY
186 Fortify_LeaveScope();
187# endif
188}
189
190#endif // defined(UNDO)
191
192VOID Action(VOID * args)
193{
194 WORKER *wk = (WORKER *)args;
195 HAB hab2;
196 HMQ hmq2;
197 CHAR **files = NULL;
198 UINT numfiles = 0, numalloc = 0;
199 INT plen = 0;
200 CHAR *p, *pp;
201 ULONG idTimerStarted = 0;
202 BOOL fActionPosted = FALSE;
203 HAB habForActions;
204 HWND hwndForActions;
205 CHAR szQuotedDirName[CCHMAXPATH];
206 CHAR szQuotedFileName[CCHMAXPATH];
207
208
209 if (wk) {
210# ifdef FORTIFY
211 Fortify_EnterScope();
212# endif
213 if (wk->li && wk->li->list && wk->li->list[0]) {
214 hab2 = WinInitialize(0);
215 if (hab2) {
216 hmq2 = WinCreateMsgQueue(hab2, 0);
217 if (hmq2) {
218 CHAR message[(CCHMAXPATH * 2) + 80], wildname[CCHMAXPATH];
219 INT x;
220 BOOL dontask = FALSE, wildcarding = FALSE, overold =
221 FALSE, overnew = FALSE, usedtarget;
222
223 WinCancelShutdown(hmq2, TRUE);
224 IncrThreadUsage();
225 *wildname = 0;
226 // Do action specific preprocessing
227 switch (wk->li->type) {
228 case IDM_MERGE:
229 if (wk->li->type == IDM_MERGE) {
230 if (TestBinary(wk->li->list[0]))
231 wk->li->type = IDM_MERGEBINARY;
232 else
233 wk->li->type = IDM_MERGETEXT;
234 }
235 strcpy(wk->li->targetpath, wk->li->list[0]);
236 p = strrchr(wk->li->targetpath, '\\');
237 if (p) {
238 p++;
239 *p = 0;
240 }
241 else
242 strcat(wk->li->targetpath, PCSZ_BACKSLASH);
243 sprintf(wk->li->targetpath + strlen(wk->li->targetpath),
244 "MERGE.%03x", (clock() & 4095L));
245 if (!WinDlgBox(HWND_DESKTOP,
246 wk->hwndFrame,
247 MergeDlgProc, FM3ModHandle, MRG_FRAME, (PVOID) wk))
248 goto Abort;
249 if (!wk->li->type ||
250 !*wk->li->targetpath || !wk->li->list || !wk->li->list[0])
251 goto Abort;
252 if (IsFile(wk->li->targetpath) != 1 && !wk->li->list[1]) {
253 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
254 wk->hwndFrame,
255 GetPString(IDS_AHEMTEXT),
256 GetPString(IDS_SILLYMERGETEXT));
257 goto Abort;
258 }
259 break;
260 case IDM_WILDMOVE:
261 wildcarding = TRUE;
262 wk->li->type = IDM_MOVE;
263 break;
264 case IDM_WILDRENAME:
265 wildcarding = TRUE;
266 wk->li->type = IDM_RENAME;
267 break;
268 case IDM_WILDCOPY:
269 wildcarding = TRUE;
270 wk->li->type = IDM_COPY;
271 break;
272 case IDM_MOVEPRESERVE:
273 {
274 CHAR preserve[CCHMAXPATH], *end;
275
276 wk->li->type = IDM_MOVE;
277 strcpy(preserve, wk->li->list[0] + 2);
278 end = strrchr(preserve, '\\');
279 if (end) {
280 end++;
281 for (x = 1; wk->li->list[x]; x++) {
282 p = preserve;
283 pp = wk->li->list[x] + 2;
284 while (p < end && toupper(*p) == toupper(*pp)) {
285 p++;
286 pp++;
287 }
288 if (*p == '\\')
289 p++;
290 if (p < end)
291 end = p;
292 }
293 *end = 0;
294 }
295 else
296 *preserve = 0;
297 plen = strlen(preserve);
298 if (plen)
299 plen += 2;
300 }
301 break;
302 case IDM_COPYPRESERVE:
303 {
304 CHAR preserve[CCHMAXPATH], *end;
305
306 wk->li->type = IDM_COPY;
307 strcpy(preserve, wk->li->list[0] + 2);
308 end = strrchr(preserve, '\\');
309 if (end) {
310 end++;
311 for (x = 1; wk->li->list[x]; x++) {
312 p = preserve;
313 pp = wk->li->list[x] + 2;
314 while (p < end && toupper(*p) == toupper(*pp)) {
315 p++;
316 pp++;
317 }
318 if (*p == '\\')
319 p++;
320 if (p < end)
321 end = p;
322 }
323 *end = 0;
324 }
325 else
326 *preserve = 0;
327 plen = strlen(preserve);
328 if (plen)
329 plen += 2;
330 }
331 break;
332 }
333 // Process each list item
334 if (wk->li && wk->li->list && wk->li->list[0]) {
335 // char ucClassname[8];
336 if (hwndStatus) {
337 // Send update request to source window or container
338 // 13 Jul 09 SHL fixme to be sure we pick window that understand UM_ACTIONSTATE wk->dcd->hwndCnr?
339 // 13 Jul 09 SHL fixme to ensure focus window is one that understands UM_ACTIONSTATE
340 HWND hwndFocus = WinQueryFocus(HWND_DESKTOP);
341 DbgMsg(pszSrcFile, __LINE__, "hwndFocus %lx", hwndFocus); // 13 Jul 09 SHL fixme debug
342 DbgMsg(pszSrcFile, __LINE__, "hwndCnr %lx", wk->hwndCnr); // 13 Jul 09 SHL fixme debug
343 // DbgMsg(pszSrcFile, __LINE__, "hwndS %lx", wk->li->hwndS); // 13 Jul 09 SHL fixme debug
344 DbgMsg(pszSrcFile, __LINE__, "hwnd %lx", wk->li->hwnd); // 13 Jul 09 SHL fixme debug
345 // DbgMsg(pszSrcFile, __LINE__, "hwndParent %lx", wk->hwndParent); // 13 Jul 09 SHL fixme debug
346 // DbgMsg(pszSrcFile, __LINE__, "hwndClient %lx", wk->hwndClient); // 13 Jul 09 SHL fixme debug
347 // DbgMsg(pszSrcFile, __LINE__, "hwndFrame %lx", wk->hwndFrame); // 13 Jul 09 SHL fixme debug
348 // hwndForActions = wk->li->hwnd == hwndFocus ? hwndFocus : wk->hwndCnr;
349 hwndForActions = WinQueryFocus(HWND_DESKTOP);
350#if 0 // 14 Jul 09 SHL fixme
351 hwndForActions = WinQueryFocus(HWND_DESKTOP);
352 if (WinQueryClassName(hwndForActions, sizeof(ucClassname), ucClassname)) {
353 // If not a container fall back to worker
354 if (strcmp(ucClassname, "#25"));
355 }
356#endif
357 habForActions = WinQueryAnchorBlock(hwndForActions);
358 DbgMsg(pszSrcFile, __LINE__, "habForActions %lx hwndForActions %lx", habForActions, hwndForActions); // 13 Jul 09 SHL fixme debug
359 // Ask container window to update status line every 5 seconds in case action is time intensive
360 idTimerStarted = WinStartTimer(habForActions, hwndForActions, ID_ACTION_TIMER, 2000); // 13 Jul 09 SHL fixme 5 sec
361 }
362 for (x = 0; wk->li->list[x]; x++) {
363 switch (wk->li->type) {
364 case IDM_COLLECTFROMFILE:
365 if (Collector) {
366
367 CHAR *temp = xstrdup(wk->li->list[x], pszSrcFile, __LINE__);
368
369 if (temp) {
370 if (!PostMsg(Collector,
371 UM_COLLECTFROMFILE, MPFROMP(temp), MPVOID))
372 free(temp);
373 }
374 }
375 break;
376
377 case IDM_MERGEBINARY:
378 case IDM_MERGETEXT:
379 case IDM_MERGEBINARYAPPEND:
380 case IDM_MERGETEXTAPPEND:
381 {
382 FILE *in, *out;
383 CHAR *moder, *modew;
384 int c;
385
386 switch (wk->li->type) {
387 case IDM_MERGEBINARY:
388 moder = "rb";
389 modew = "wb";
390 break;
391 case IDM_MERGEBINARYAPPEND:
392 moder = "rb";
393 modew = "a+b";
394 break;
395 case IDM_MERGETEXTAPPEND:
396 moder = "r";
397 modew = "a+";
398 break;
399 default:
400 moder = "r";
401 modew = "w";
402 break;
403 }
404 in = _fsopen(wk->li->list[x], moder, SH_DENYWR);
405 if (!in) {
406 if (saymsg(MB_ENTERCANCEL,
407 HWND_DESKTOP,
408 GetPString(IDS_MERGEERRORTEXT),
409 GetPString(IDS_CANTOPENINPUTTEXT),
410 wk->li->list[x]) == MBID_CANCEL)
411 goto Abort;
412 }
413 else {
414 out = _fsopen(wk->li->targetpath, modew, SH_DENYWR);
415 if (out) {
416 fseek(out, 0L, SEEK_END);
417 switch (wk->li->type) {
418 case IDM_MERGEBINARY:
419 wk->li->type = IDM_MERGEBINARYAPPEND;
420 break;
421 default:
422 wk->li->type = IDM_MERGETEXTAPPEND;
423 break;
424 }
425 sprintf(message,
426 GetPString(IDS_MERGINGTEXT),
427 wk->li->list[x], wk->li->targetpath);
428 AddNote(message);
429 while ((c = fgetc(in)) != EOF)
430 fputc(c, out);
431 fclose(out);
432 sprintf(message,
433 GetPString(IDS_MERGECOMPLETETEXT),
434 wk->li->list[x], wk->li->targetpath);
435 AddNote(message);
436 }
437 else {
438 saymsg(MB_CANCEL,
439 HWND_DESKTOP,
440 GetPString(IDS_MERGEERRORTEXT),
441 GetPString(IDS_CANTOPENOUTPUTTEXT),
442 wk->li->targetpath);
443 fclose(in);
444 goto Abort;
445 }
446 fclose(in);
447 }
448 }
449 break;
450
451 case IDM_UUDECODE:
452 {
453 CHAR outname[CCHMAXPATH + 2];
454
455 sprintf(message,
456 GetPString(IDS_UUDECODINGTEXT), wk->li->list[x]);
457 AddNote(message);
458 if (UUD(wk->li->list[x], outname) && *outname) {
459 sprintf(message,
460 GetPString(IDS_UUDECODECOMPLETETEXT),
461 wk->li->list[x]);
462 AddNote(message);
463 if (//fSyncUpdates ||
464 AddToList(outname, &files, &numfiles, &numalloc))
465 Broadcast(hab2,
466 wk->hwndCnr,
467 UM_UPDATERECORD, MPFROMP(outname), MPVOID);
468 }
469 else {
470 sprintf(message,
471 GetPString(IDS_UUDECODEABORTEDTEXT),
472 wk->li->list[x]);
473 AddNote(message);
474 }
475 }
476 break;
477
478 case IDM_VIEWARCHIVE:
479 if (IsFile(wk->li->list[x]) > 0) {
480
481 ARC_TYPE *info = NULL; // Say calling for editing - fixme to know why?
482
483 if (WinDlgBox(HWND_DESKTOP,
484 wk->hwndFrame,
485 SBoxDlgProc,
486 FM3ModHandle,
487 ASEL_FRAME, (PVOID) & info) && info) {
488 WinSendMsg(wk->hwndCnr,
489 UM_OPENWINDOWFORME,
490 MPFROMP(wk->li->list[x]), MPFROMP(info));
491 }
492 }
493 break;
494
495 case IDM_EXTRACT:
496 {
497 EXTRDATA ex;
498 BOOL maskspaces = FALSE;
499
500 memset(&ex, 0, sizeof(EXTRDATA));
501 ex.info = find_type(wk->li->list[x], NULL);
502 if (!ex.info || (!ex.info->extract && !ex.info->exwdirs))
503 break;
504 ex.size = sizeof(EXTRDATA);
505 ex.arcname = wk->li->list[x];
506 strcpy(ex.masks, "*");
507 strcpy(ex.extractdir, wk->li->targetpath);
508 if (!WinDlgBox(HWND_DESKTOP,
509 wk->hwndFrame,
510 ExtractDlgProc,
511 FM3ModHandle,
512 EXT_FRAME,
513 (PVOID) & ex) ||
514 !ex.ret ||
515 !*ex.command || !*ex.arcname || !*ex.extractdir)
516 goto Abort;
517 {
518 FILESTATUS3 fsa;
519
520 DosError(FERR_DISABLEHARDERR);
521 if (DosQueryPathInfo(ex.extractdir,
522 FIL_STANDARD,
523 &fsa,
524 (ULONG) sizeof(FILESTATUS3)) ||
525 !(fsa.attrFile & FILE_DIRECTORY))
526 goto Abort;
527 }
528 if (needs_quoting(ex.masks) && !strchr(ex.masks, '\"'))
529 maskspaces = TRUE;
530 if (!runemf2(SEPARATE | WINDOWED | WAIT |
531 fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED),
532 HWND_DESKTOP, pszSrcFile, __LINE__, ex.extractdir, NULL,
533 "%s %s %s%s%s",
534 ex.command,
535 ex.arcname,
536 maskspaces ? "\"" : NullStr,
537 *ex.masks ? ex.masks : "\"*\"",
538 maskspaces ? "\"" : NullStr) &&
539 !stricmp(ex.extractdir, wk->directory)) {
540 DosSleep(100); // wait for runemf2 to complete so rescan will actually show something
541 if (WinIsWindow((HAB) 0, wk->hwndCnr))
542 WinSendMsg(wk->hwndCnr,
543 WM_COMMAND,
544 MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
545 }
546 }
547 break;
548
549 case IDM_SUBJECT:
550 {
551 INT ret;
552
553 ret = Subject(wk->hwndFrame, wk->li->list[x]);
554 if (!ret)
555 goto Abort;
556 if (ret == 1) {
557 if (//fSyncUpdates ||
558 AddToList(wk->li->list[x],
559 &files, &numfiles, &numalloc))
560 Broadcast(hab2,
561 wk->hwndCnr,
562 UM_UPDATERECORD,
563 MPFROMP(wk->li->list[x]), MPVOID);
564 }
565 }
566 break;
567
568 case IDM_INFO:
569 if (IsFullName(wk->li->list[x]) &&
570 !(driveflags[toupper(*wk->li->list[x]) - 'A'] &
571 DRIVE_INVALID)) {
572 if (!IsRoot(wk->li->list[x])) {
573
574 CHAR *list[2];
575
576 list[0] = wk->li->list[x];
577 list[1] = NULL;
578 if (!WinDlgBox(HWND_DESKTOP,
579 HWND_DESKTOP,
580 FileInfoProc,
581 FM3ModHandle, FLE_FRAME, (PVOID) list)) {
582 goto Abort;
583 }
584 }
585 else {
586 if (!WinDlgBox(HWND_DESKTOP,
587 HWND_DESKTOP,
588 DrvInfoProc,
589 FM3ModHandle,
590 INFO_FRAME, (PVOID) wk->li->list[x]))
591 goto Abort;
592 }
593 }
594 break;
595
596 case IDM_OPENWINDOW:
597 if (!IsFile(wk->li->list[x]) &&
598 WinIsWindow(hab2, wk->hwndCnr))
599 WinSendMsg(wk->hwndCnr,
600 UM_OPENWINDOWFORME,
601 MPFROMP(wk->li->list[x]), MPVOID);
602 break;
603
604 case IDM_OPENICON:
605 case IDM_OPENDETAILS:
606 case IDM_OPENTREE:
607 {
608 FILESTATUS3 fsa;
609
610 DosError(FERR_DISABLEHARDERR);
611 if (DosQueryPathInfo(wk->li->list[x],
612 FIL_STANDARD,
613 &fsa,
614 (ULONG) sizeof(FILESTATUS3)) ||
615 !(fsa.attrFile & FILE_DIRECTORY))
616 break;
617 }
618 /* else intentional fallthru */
619 case IDM_OPENDEFAULT:
620 case IDM_OPENSETTINGS:
621 {
622 CHAR *s;
623
624 switch (wk->li->type) {
625 case IDM_OPENICON:
626 s = (PSZ) PCSZ_ICON;
627 break;
628 case IDM_OPENDETAILS:
629 s = (PSZ) Details;
630 break;
631 case IDM_OPENTREE:
632 s = (PSZ) PCSZ_TREE;
633 break;
634 case IDM_OPENSETTINGS:
635 s = (PSZ) Settings;
636 break;
637 default:
638 s = (PSZ) Default;
639 break;
640 }
641 OpenObject(wk->li->list[x], s, wk->hwndFrame);
642 }
643 break;
644
645 case IDM_WPSMOVE:
646 case IDM_WPSCOPY:
647 case IDM_MOVE:
648 case IDM_COPY:
649 case IDM_RENAME:
650 {
651
652 if (!*wk->li->targetpath && (wk->li->type == IDM_MOVE ||
653 wk->li->type == IDM_COPY ||
654 wk->li->type == IDM_WPSMOVE ||
655 wk->li->type == IDM_WPSCOPY)) {
656
657 APIRET rc = 1;
658
659 usedtarget = FALSE;
660 if (hwndMain) {
661 if (!*targetdir)
662 TopWindowName(hwndMain,
663 wk->hwndFrame, wk->li->targetpath);
664 else {
665 strcpy(wk->li->targetpath, targetdir);
666 usedtarget = TRUE;
667 }
668 }
669 if (!*wk->li->targetpath)
670 strcpy(wk->li->targetpath, wk->directory);
671 if (!*wk->li->targetpath) {
672 strcpy(wk->li->targetpath, wk->li->list[0]);
673 p = strrchr(wk->li->targetpath, '\\');
674 if (p) {
675 if (*(p - 1) == ':')
676 p++;
677 *p = 0;
678 }
679 }
680 MakeValidDir(wk->li->targetpath);
681 if (fConfirmTarget ||
682 (!*targetdir && strcmp(realappname, "FM/4"))) {
683 RetryPath:
684 usedtarget = FALSE;
685 if (wk->li->type == IDM_MOVE ||
686 wk->li->type == IDM_WPSMOVE) {
687 rc = WinDlgBox(HWND_DESKTOP,
688 wk->hwndFrame,
689 WalkMoveDlgProc,
690 FM3ModHandle,
691 WALK_FRAME, MPFROMP(wk->li->targetpath));
692 }
693 else if (wk->li->type == IDM_COPY ||
694 wk->li->type == IDM_WPSCOPY) {
695 rc = WinDlgBox(HWND_DESKTOP,
696 wk->hwndFrame,
697 WalkCopyDlgProc,
698 FM3ModHandle,
699 WALK_FRAME, MPFROMP(wk->li->targetpath));
700 }
701 else
702 rc = WinDlgBox(HWND_DESKTOP,
703 wk->hwndFrame,
704 WalkDlgProc,
705 FM3ModHandle,
706 WALK_FRAME, MPFROMP(wk->li->targetpath));
707 }
708 if (!rc || !*wk->li->targetpath)
709 goto Abort;
710 if (driveflags[toupper(*wk->li->targetpath) - 'A'] &
711 DRIVE_NOTWRITEABLE) {
712 saymsg(MB_CANCEL,
713 wk->hwndFrame,
714 GetPString(IDS_ERRORTEXT),
715 GetPString(IDS_NOTWRITENOTARGETTEXT));
716 goto RetryPath;
717 }
718 }
719 Retry:
720 {
721 CHAR newname[CCHMAXPATH];
722 PCSZ moving, move, moved;
723 APIRET rc;
724 INT type;
725 FILESTATUS4L fs4;
726 BOOL isnewer, existed, fResetVerify = FALSE;
727
728 type = (wk->li->type == IDM_RENAME) ? MOVE :
729 (wk->li->type == IDM_MOVE) ? MOVE :
730 (wk->li->type == IDM_WPSMOVE) ? WPSMOVE :
731 (wk->li->type == IDM_WPSCOPY) ? WPSCOPY : COPY;
732 moving = (wk->li->type == IDM_RENAME) ?
733 GetPString(IDS_RENAMINGTEXT) :
734 (wk->li->type == IDM_MOVE ||
735 wk->li->type == IDM_WPSMOVE) ?
736 GetPString(IDS_MOVINGTEXT) : GetPString(IDS_COPYINGTEXT);
737 move = (wk->li->type == IDM_RENAME) ?
738 GetPString(IDS_RENAMETEXT) :
739 (wk->li->type == IDM_MOVE ||
740 wk->li->type == IDM_WPSMOVE) ?
741 GetPString(IDS_MOVETEXT) : GetPString(IDS_COPYTEXT);
742 moved = (wk->li->type == IDM_RENAME) ?
743 GetPString(IDS_RENAMEDTEXT) :
744 (wk->li->type == IDM_MOVE ||
745 wk->li->type == IDM_WPSMOVE) ?
746 GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT);
747 if (*wk->li->targetpath) {
748 strcpy(newname, wk->li->targetpath);
749 AddBackslashToPath(newname);
750 //if (newname[strlen(newname) - 1] != '\\')
751 // strcat(newname, "\\");
752 if (plen)
753 p = wk->li->list[x] + plen;
754 else {
755 p = strrchr(wk->li->list[x], '\\');
756 if (p)
757 p++;
758 else
759 p = wk->li->list[x];
760 }
761 strcat(newname, p);
762 }
763 else
764 strcpy(newname, wk->li->list[x]);
765 if ((wildcarding || wk->li->type == IDM_RENAME) &&
766 *wildname) {
767
768 CHAR testname[CCHMAXPATH];
769
770 strcpy(testname, wildname);
771 if (AdjustWildcardName(newname, testname))
772 strcpy(newname, testname);
773 }
774 existed = (IsFile(newname) != -1);
775 isnewer = IsNewer(wk->li->list[x], newname);
776 if (existed && wk->li->type != IDM_RENAME && dontask) {
777 if (!overold && !overnew)
778 break;
779 if (!overold && !isnewer)
780 break;
781 if (!overnew && isnewer)
782 break;
783 }
784 if ((wk->li->type == IDM_RENAME &&
785 (!dontask || !*wildname)) ||
786 (!dontask && existed) ||
787 (!dontask && wildcarding) ||
788 (IsFile(newname) == 0 && IsFile(wk->li->list[x]) > 0)) {
789
790 MOVEIT mv;
791
792 memset(&mv, 0, sizeof(MOVEIT));
793 mv.rename = (wk->li->type == IDM_RENAME);
794 mv.source = wk->li->list[x];
795 strcpy(mv.target, newname);
796 rc = WinDlgBox(HWND_DESKTOP,
797 wk->hwndFrame,
798 RenameProc,
799 FM3ModHandle, REN_FRAME, (PVOID) & mv);
800 if (!rc)
801 goto Abort;
802 DosSleep(1);
803 if (mv.skip || !*mv.target)
804 break;
805 if (mv.dontask)
806 dontask = TRUE;
807 if (mv.overold)
808 overold = TRUE;
809 if (mv.overnew)
810 overnew = TRUE;
811 if (wildcarding || wk->li->type == IDM_RENAME) {
812 p = strrchr(mv.target, '\\');
813 if (p && (strchr(p, '*') || strchr(p, '?'))) {
814 strcpy(wildname, mv.target);
815 AdjustWildcardName(wk->li->list[x], mv.target);
816 }
817 else
818 *wildname = 0;
819 }
820 strcpy(newname, mv.target);
821 existed = (IsFile(newname) != -1);
822 isnewer = IsNewer(wk->li->list[x], newname);
823 if (!mv.overwrite) {
824 if (existed && wk->li->type != IDM_RENAME && dontask) {
825 if (!overold && !overnew)
826 break;
827 if (!overold && !isnewer)
828 break;
829 if (!overnew && isnewer)
830 break;
831 }
832 }
833 }
834 if (!strcmp(wk->li->list[x], newname) ||
835 (wk->li->type == IDM_COPY &&
836 !stricmp(wk->li->list[x], newname)))
837 break;
838 sprintf(message,
839 " %s \"%s\" %s\"%s\"%s",
840 moving,
841 wk->li->list[x],
842 GetPString(IDS_TOTEXT),
843 newname,
844 (usedtarget) ? GetPString(IDS_TOTARGETTEXT) :
845 NullStr);
846 AddNote(message);
847 if (fVerify && (driveflags[toupper(*wk->li->targetpath) - 'A'] & DRIVE_WRITEVERIFYOFF) |
848 (driveflags[toupper(*wk->li->list[x]) - 'A'] & DRIVE_WRITEVERIFYOFF)) {
849 DosSetVerify(FALSE);
850 fResetVerify = TRUE;
851 }
852 if (plen) {
853 /* make directory/ies, if required */
854
855 CHAR dirpart[CCHMAXPATH];
856
857 strcpy(dirpart, newname);
858 p = strrchr(dirpart, '\\');
859 if (p) {
860 *p = 0;
861 if (p > dirpart + 3)
862 MassMkdir((hwndMain) ? hwndMain : wk->hwndCnr,
863 dirpart);
864 }
865 }
866 if (fRealIdle)
867 priority_idle();
868
869 rc = docopyf(type, wk->li->list[x], newname);
870 if (fResetVerify) {
871 DosSetVerify(fVerify);
872 fResetVerify = FALSE;
873 }
874 priority_normal();
875 if (rc) {
876 if ((rc == ERROR_DISK_FULL ||
877 rc == ERROR_HANDLE_DISK_FULL) &&
878 isalpha(*newname) &&
879 (driveflags[toupper(*newname) - 'A'] &
880 DRIVE_REMOVABLE)
881 && !(driveflags[toupper(*newname) - 'A'] &
882 DRIVE_NOTWRITEABLE)
883 && toupper(*newname) != toupper(*wk->li->list[x])
884 && !DosQueryPathInfo(wk->li->list[x], FIL_QUERYEASIZEL,
885 &fs4, sizeof(fs4))
886 && !(fs4.attrFile & FILE_DIRECTORY)) {
887
888 FSALLOCATE fsa;
889 ULONGLONG ullFreeBytes;
890 CHAR *ptr;
891 INT cntr;
892
893 Notify(GetPString(IDS_FITTINGTEXT));
894 DosError(FERR_DISABLEHARDERR);
895 if (!DosQueryFSInfo(toupper(*newname) - '@',
896 FSIL_ALLOC,
897 &fsa, sizeof(FSALLOCATE))) {
898 // Assume large file support
899 ullFreeBytes = (ULONGLONG) fsa.cUnitAvail * fsa.cSectorUnit *
900 fsa.cbSector;
901 if (ullFreeBytes) {
902 // Find item that will fit in available space
903 for (cntr = x + 1; wk->li->list[cntr]; cntr++) {
904 DosError(FERR_DISABLEHARDERR);
905 if (!DosQueryPathInfo(wk->li->list[cntr],
906 FIL_QUERYEASIZEL,
907 &fs4,
908 sizeof(fs4)) &&
909 !(fs4.attrFile & FILE_DIRECTORY) &&
910 // fixme to use CBLIST_TO_EASIZE?
911 fs4.cbFile + fs4.cbList <= ullFreeBytes) {
912 // Swap with failing item
913 ptr = wk->li->list[x];
914 wk->li->list[x] = wk->li->list[cntr];
915 wk->li->list[cntr] = ptr;
916 goto Retry;
917 }
918 }
919 Notify(GetPString(IDS_COULDNTFITTEXT));
920 }
921 }
922 rc = saymsg(MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION,
923 wk->hwndFrame,
924 GetPString(IDS_DISKFULLTEXT),
925 GetPString(IDS_ANOTHERDISKTEXT));
926 if (rc == MBID_RETRY)
927 goto Retry;
928 if (rc == MBID_ABORT)
929 goto Abort;
930 }
931 else {
932 if (LogFileHandle) {
933 fprintf(LogFileHandle,
934 GetPString(IDS_LOGTOFAILEDTEXT),
935 move, wk->li->list[x], newname, rc);
936 }
937 rc = Dos_Error(MB_ENTERCANCEL,
938 rc,
939 wk->hwndFrame,
940 pszSrcFile,
941 __LINE__,
942 "%s %s \"%s\" %s\"%s\" %s.",
943 move,
944 GetPString(IDS_OFTEXT),
945 wk->li->list[x],
946 GetPString(IDS_TOTEXT),
947 newname, GetPString(IDS_FAILEDTEXT));
948 if (rc == MBID_CANCEL)
949 goto Abort;
950 }
951 }
952 else {
953 if (LogFileHandle) {
954 fprintf(LogFileHandle,
955 "%s \"%s\" %s\"%s\"\n",
956 moved,
957 wk->li->list[x],
958 GetPString(IDS_TOTEXT), newname);
959 }
960 if (!hwndTree ||
961 ((driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) &&
962 AddToList(wk->li->list[x],
963 &files, &numfiles, &numalloc)))
964 Broadcast(hab2,
965 wk->hwndCnr,
966 UM_UPDATERECORD,
967 MPFROMP(wk->li->list[x]), MPVOID);
968 if (!hwndTree ||
969 (driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) &&
970 AddToList(newname, &files, &numfiles, &numalloc))
971 Broadcast(hab2,
972 wk->hwndCnr,
973 UM_UPDATERECORD, MPFROMP(newname), MPVOID);
974 }
975 }
976 break;
977 }
978
979 case IDM_COMPARE:
980 if ((!IsFile(wk->li->targetpath) ||
981 IsRoot(wk->li->targetpath)) &&
982 (!IsFile(wk->li->list[x]) || IsRoot(wk->li->list[x]))) {
983 if (!*dircompare && WinIsWindow(hab2, wk->hwndCnr))
984 WinSendMsg(wk->hwndCnr,
985 UM_COMPARE,
986 MPFROMP(wk->li->targetpath),
987 MPFROMP(wk->li->list[x]));
988 else {
989 runemf2(SEPARATE,
990 HWND_DESKTOP, pszSrcFile, __LINE__,
991 NULL, NULL,
992 "%s %s %s",
993 dircompare,
994 BldQuotedFileName(szQuotedDirName, wk->li->targetpath),
995 BldQuotedFileName(szQuotedFileName, wk->li->list[x]));
996 }
997 }
998 else if (*compare) {
999 CHAR *fakelist[3];
1000
1001 fakelist[0] = wk->li->list[x];
1002 fakelist[1] = wk->li->targetpath;
1003 fakelist[2] = NULL;
1004 ExecOnList(wk->hwndFrame,
1005 compare,
1006 WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL,
1007 pszSrcFile, __LINE__);
1008 }
1009 else {
1010 FCOMPARE fc;
1011
1012 memset(&fc, 0, sizeof(fc));
1013 fc.size = sizeof(fc);
1014 fc.hwndParent = wk->hwndParent;
1015 strcpy(fc.file1, wk->li->list[x]);
1016 strcpy(fc.file2, wk->li->targetpath);
1017 if (WinDlgBox(HWND_DESKTOP,
1018 wk->hwndFrame,
1019 CFileDlgProc,
1020 FM3ModHandle, FCMP_FRAME, (PVOID) & fc))
1021 goto Abort;
1022 }
1023 break;
1024 } // switch
1025 DosSleep(0);
1026 } // for list
1027
1028 // Do actio specific post-processing
1029 switch (wk->li->type) {
1030 case IDM_MOVE:
1031 case IDM_COPY:
1032 case IDM_WPSMOVE:
1033 case IDM_WPSCOPY:
1034 case IDM_RENAME:
1035 sprintf(message,
1036 GetPString(IDS_OPSCOMPLETETEXT),
1037 (wk->li->type == IDM_MOVE) ?
1038 GetPString(IDS_MOVETEXT) :
1039 (wk->li->type == IDM_COPY) ?
1040 GetPString(IDS_COPYTEXT) :
1041 (wk->li->type == IDM_WPSMOVE) ?
1042 GetPString(IDS_WPSMOVETEXT) :
1043 (wk->li->type == IDM_WPSCOPY) ?
1044 GetPString(IDS_WPSCOPYTEXT) :
1045 GetPString(IDS_RENAMETEXT),
1046 &"s"[x == 1],
1047 (wk->li->type == IDM_MOVE ||
1048 wk->li->type == IDM_COPY ||
1049 wk->li->type == IDM_WPSMOVE ||
1050 wk->li->type == IDM_WPSCOPY) ?
1051 GetPString(IDS_TOTEXT) :
1052 NullStr,
1053 (wk->li->type == IDM_MOVE ||
1054 wk->li->type == IDM_COPY ||
1055 wk->li->type == IDM_WPSMOVE ||
1056 wk->li->type == IDM_WPSCOPY) ?
1057 wk->li->targetpath :
1058 NullStr,
1059 (x != 1) ?
1060 GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
1061 Notify(message);
1062 if (toupper(*wk->li->targetpath) < 'C' && !fAlertBeepOff)
1063 DosBeep(1000, 25); // Wake up user
1064 DosSleep(16);//05 Aug 07 GKY 33
1065 if (wk->li->type == IDM_WPSMOVE || wk->li->type == IDM_WPSCOPY)
1066 DosSleep(48);//05 Aug 07 GKY 96
1067 break;
1068 default:
1069 break;
1070 }
1071 if (idTimerStarted)
1072 WinStopTimer(habForActions, hwndForActions, ID_ACTION_TIMER); // 13 Jul 09 SHL
1073 } // if have non-empty list
1074
1075 Abort:
1076
1077 if (files) {
1078 if (!hwndTree || (driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED))
1079 Broadcast(hab2,
1080 wk->hwndCnr,
1081 UM_UPDATERECORDLIST, MPFROMP(files), MPVOID);
1082 FreeList(files);
1083 }
1084
1085 if (WinIsWindow(hab2, wk->hwndCnr))
1086 PostMsg(wk->hwndCnr, UM_RESCAN, MPVOID, MPVOID);
1087
1088 WinDestroyMsgQueue(hmq2);
1089 }
1090 DecrThreadUsage();
1091 WinTerminate(hab2);
1092 }
1093 }
1094
1095 if (fActionPosted)
1096 DosSleep(2000); // Alloc container time to process queued UM_ACTIONSTATE messages 13 Jul 09 SHL
1097 if (wk->li)
1098 FreeListInfo(wk->li);
1099 free(wk);
1100# ifdef FORTIFY
1101 Fortify_LeaveScope();
1102# endif
1103 DosPostEventSem(CompactSem);
1104 }
1105}
1106
1107VOID MassAction(VOID * args)
1108{
1109 WORKER *wk = (WORKER *) args;
1110 HAB hab2;
1111 HMQ hmq2;
1112 CHAR **files = NULL;
1113 register CHAR *p, *pp;
1114 UINT numfiles = 0, numalloc = 0;
1115
1116
1117 if (wk) {
1118# ifdef FORTIFY
1119 // Fortify_BecomeOwner(wk);
1120 Fortify_EnterScope();
1121# endif
1122 if (wk->li && wk->li->list && wk->li->list[0]) {
1123 hab2 = WinInitialize(0);
1124 if (hab2) {
1125 hmq2 = WinCreateMsgQueue(hab2, 0);
1126 if (hmq2) {
1127 WinCancelShutdown(hmq2, TRUE);
1128 IncrThreadUsage();
1129 DosError(FERR_DISABLEHARDERR);
1130 if (IsRoot(wk->li->list[0]) || !IsFile(wk->li->list[0])) {
1131 if (wk->li->type == IDM_VIEW)
1132 wk->li->type = IDM_INFO;
1133 if (wk->li->type == IDM_EDIT)
1134 wk->li->type = IDM_EAS;
1135 }
1136 switch (wk->li->type) {
1137 case IDM_INFO:
1138 if (WinDlgBox(HWND_DESKTOP,
1139 wk->hwndFrame,
1140 FileInfoProc,
1141 FM3ModHandle, FLE_FRAME, (PVOID) wk->li->list) != 2)
1142 {
1143 break;
1144 }
1145 /* else intentional fallthru */
1146 case IDM_UPDATE:
1147 Broadcast(hab2,
1148 wk->hwndCnr,
1149 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1150 break;
1151
1152 case IDM_EAS:
1153 if (WinDlgBox(HWND_DESKTOP,
1154 wk->hwndFrame,
1155 DisplayEAsProc,
1156 FM3ModHandle, EA_FRAME, (PVOID) wk->li->list))
1157 Broadcast(hab2,
1158 wk->hwndCnr,
1159 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1160 break;
1161
1162 case IDM_DOITYOURSELF:
1163 ExecOnList(wk->hwndFrame,
1164 "%a",
1165 WINDOWED | SEPARATE | PROMPT,
1166 NULL, wk->li->list, GetPString(IDS_DOITYOURSELFTEXT),
1167 pszSrcFile, __LINE__);
1168 break;
1169
1170 case IDM_MCIPLAY:
1171 {
1172 INT x, MaxFM2playStrLen = 24;
1173 ULONG total;
1174 CHAR fbuf[CCHMAXPATH];
1175
1176 if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
1177 SEARCH_CUR_DIRECTORY,
1178 PCSZ_PATH, PCSZ_FM2PLAYEXE, (PBYTE)fbuf, CCHMAXPATH - 1))
1179 total += MaxFM2playStrLen;
1180 else
1181 total = strlen(fbuf);
1182 for (x = 0; wk->li->list[x]; x++)
1183 total += (strlen(wk->li->list[x]) + 1 +
1184 (needs_quoting(wk->li->list[x]) * 2));
1185 if (total > 1000) {
1186
1187 FILE *fp;
1188 CHAR szTempFile[CCHMAXPATH];
1189
1190 BldFullPathName(szTempFile, pTmpDir, PCSZ_FM2PLAYTEMP);
1191 fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__);
1192 if (fp) {
1193 fprintf(fp, "%s", ";AV/2-built FM2Play listfile\n");
1194 for (x = 0; wk->li->list[x]; x++)
1195 fprintf(fp, "%s\n", wk->li->list[x]);
1196 fprintf(fp, ";end\n");
1197 fclose(fp);
1198 strrev(szTempFile);
1199 strcat(szTempFile, "@/");
1200 strrev(szTempFile);
1201 RunFM2Util(PCSZ_FM2PLAYEXE, szTempFile);
1202 }
1203 }
1204 }
1205 /* intentional fallthru */
1206 case IDM_FAKEEXTRACT:
1207 case IDM_FAKEEXTRACTM:
1208 if (wk->li->type == IDM_MCIPLAY ||
1209 (*wk->li->arcname && wk->li->info &&
1210 wk->li->info->extract && *wk->li->targetpath)) {
1211
1212 CHAR szBuffer[1025];
1213 CHAR fbuf[CCHMAXPATH];
1214 register INT x;
1215
1216 if (wk->li->type == IDM_FAKEEXTRACT ||
1217 wk->li->type == IDM_FAKEEXTRACTM) {
1218 strcpy(szBuffer,
1219 (wk->li->info->exwdirs) ?
1220 wk->li->info->exwdirs : wk->li->info->extract);
1221 strcat(szBuffer, " ");
1222 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->arcname);
1223 }
1224 else {
1225 if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
1226 SEARCH_CUR_DIRECTORY,
1227 PCSZ_PATH, PCSZ_FM2PLAYEXE, (PBYTE)fbuf, CCHMAXPATH - 1))
1228 strcpy(szBuffer, "UTILS\\FM2PLAY.EXE");
1229 else
1230 strcpy(szBuffer, PCSZ_FM2PLAYEXE);
1231 }
1232 p = &szBuffer[strlen(szBuffer)];
1233 strcat(szBuffer, " ");
1234 x = 0;
1235 while (wk->li->list[x]) {
1236 pp = wk->li->list[x];
1237 while (*pp) {
1238 if (*pp == '/')
1239 *pp = '\\';
1240 pp++;
1241 }
1242 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]);
1243 x++;
1244 if (!wk->li->list[x] || strlen(szBuffer) +
1245 strlen(wk->li->list[x]) + 5 > 1024) {
1246 runemf2(SEPARATE | WINDOWED | BACKGROUND | MINIMIZED | WAIT,
1247 HWND_DESKTOP, pszSrcFile, __LINE__,
1248 (wk->li->type == IDM_FAKEEXTRACT ||
1249 wk->li->type == IDM_FAKEEXTRACTM) ?
1250 wk->li->targetpath : NULL,
1251 NULL,
1252 "%s", szBuffer);
1253 DosSleep(1);
1254 *p = 0;
1255 }
1256 strcat(szBuffer, " ");
1257 }
1258 if (wk->li->type == IDM_MCIPLAY)
1259 break;
1260 strcpy(szBuffer, wk->li->targetpath);
1261 AddBackslashToPath(wk->li->targetpath);
1262 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != '\\')
1263 // strcat(szBuffer, "\\");
1264 p = szBuffer + strlen(szBuffer);
1265 for (x = 0; wk->li->list[x]; x++) {
1266 strcpy(p, wk->li->list[x]);
1267 free(wk->li->list[x]);
1268 wk->li->list[x] = xstrdup(szBuffer, pszSrcFile, __LINE__);
1269 }
1270 if (wk->li->list[0])
1271 Broadcast(hab2,
1272 wk->hwndCnr,
1273 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1274 }
1275 break;
1276
1277 case IDM_SETICON:
1278 if (*wk->li->targetpath) {
1279
1280 ICONINFO ici;
1281
1282 memset(&ici, 0, sizeof(ICONINFO));
1283 ici.cb = sizeof(ICONINFO);
1284 ici.fFormat = ICON_FILE;
1285 ici.pszFileName = wk->li->list[0];
1286 if (!WinSetFileIcon((PSZ) wk->li->targetpath,
1287 (PICONINFO) & ici)) {
1288 ici.fFormat = ICON_CLEAR;
1289 WinSetFileIcon((PSZ) wk->li->targetpath, (PICONINFO) & ici);
1290 }
1291 Broadcast(hab2,
1292 wk->hwndCnr,
1293 UM_UPDATERECORD, MPFROMP(wk->li->targetpath), MPVOID);
1294 }
1295 break;
1296
1297 case IDM_APPENDTOCLIP:
1298 case IDM_SAVETOCLIP:
1299 case IDM_SAVETOCLIPFILENAME:
1300 case IDM_APPENDTOCLIPFILENAME:
1301 ListToClipboardHab(hab2,
1302 wk->li->list,
1303 wk->li->type);
1304 break;
1305
1306 case IDM_ARCHIVEM:
1307 case IDM_ARCHIVE:
1308 {
1309 DIRCNRDATA ad;
1310 CHAR szBuffer[1025];
1311 ARC_TYPE *info = NULL;
1312 char *pch;
1313 register INT x;
1314
1315 memset(&ad, 0, sizeof(DIRCNRDATA));
1316 strcpy(ad.arcname, wk->li->targetpath);
1317 if (*wk->li->targetpath && IsFile(wk->li->targetpath) > 0) {
1318 info = find_type(wk->li->targetpath, NULL);
1319 ad.namecanchange = 0;
1320 }
1321 else {
1322 if (*wk->li->targetpath && !IsFile(wk->li->targetpath))
1323 AddBackslashToPath(wk->li->targetpath);
1324 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] !=
1325 // '\\')
1326 // strcat(wk->li->targetpath, "\\");
1327 ad.namecanchange = 1;
1328 }
1329 strcpy(ad.arcname, wk->li->targetpath);
1330 if (wk->li->type == IDM_ARCHIVEM)
1331 ad.fmoving = TRUE;
1332 if (!info) {
1333 ad.info = arcsighead; // Hide dups
1334 if (!WinDlgBox(HWND_DESKTOP,
1335 wk->hwndFrame,
1336 SBoxDlgProc,
1337 FM3ModHandle,
1338 ASEL_FRAME, (PVOID) & ad.info) || !ad.info) {
1339 break; /* we blew it */
1340 }
1341 }
1342 else
1343 ad.info = info;
1344 if (!ad.info || (!ad.info->create &&
1345 !ad.info->move &&
1346 !ad.info->createwdirs &&
1347 !ad.info->movewdirs &&
1348 !ad.info->createrecurse))
1349 break;
1350 if (!*wk->li->targetpath && *wk->directory) {
1351 strcpy(ad.arcname, wk->directory);
1352 AddBackslashToPath(ad.arcname);
1353 //if (ad.arcname[strlen(ad.arcname) - 1] != '\\')
1354 // strcat(ad.arcname, "\\");
1355 }
1356 if (!WinDlgBox(HWND_DESKTOP, wk->hwndFrame, ArchiveDlgProc, FM3ModHandle,
1357 ARCH_FRAME, (PVOID) & ad) || !*ad.arcname || !*ad.command) /* we blew it */
1358 break;
1359 // Provide extension so containers work
1360 pch = strrchr(ad.arcname, '\\');
1361 if (pch)
1362 pch = strrchr(pch, '.');
1363 else
1364 pch = strrchr(ad.arcname, '.');
1365 if (!pch && ad.info->ext) {
1366 strcat(ad.arcname, ".");
1367 strcat(ad.arcname, ad.info->ext);
1368 }
1369 /* build the sucker */
1370 strcpy(szBuffer, ad.command);
1371 strcat(szBuffer, " ");
1372 BldQuotedFileName(szBuffer + strlen(szBuffer), ad.arcname);
1373 p = &szBuffer[strlen(szBuffer)];
1374 if (ad.mask.szMask) {
1375 strcat(szBuffer, " ");
1376 strcat(szBuffer, ad.mask.szMask);
1377 }
1378 strcat(szBuffer, " ");
1379 x = 0;
1380 while (wk->li->list[x]) {
1381 FILESTATUS3 fsa;
1382 memset(&fsa, 0, sizeof(FILESTATUS3));
1383 DosError(FERR_DISABLEHARDERR);
1384 DosQueryPathInfo(wk->li->list[x],
1385 FIL_STANDARD,
1386 &fsa, (ULONG) sizeof(FILESTATUS3));
1387 if (fsa.attrFile & FILE_DIRECTORY) {
1388 BldQuotedFullPathName(szBuffer + strlen(szBuffer), wk->li->list[x], "*");
1389 }
1390 else
1391 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]);
1392 x++;
1393 if (!wk->li->list[x] ||
1394 strlen(szBuffer) + strlen(wk->li->list[x]) + 5 > 1024) {
1395 runemf2(SEPARATE | WINDOWED | WAIT |
1396 (fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED)),
1397 HWND_DESKTOP, pszSrcFile, __LINE__, NULL, NULL,
1398 "%s", szBuffer);
1399 DosSleep(1);
1400 *p = 0;
1401 }
1402 strcat(szBuffer, " ");
1403 }
1404 Broadcast(hab2,
1405 wk->hwndCnr,
1406 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1407 Broadcast(hab2,
1408 wk->hwndCnr,
1409 UM_UPDATERECORD, MPFROMP(ad.arcname), MPVOID);
1410 }
1411 break;
1412
1413 case IDM_VIEW:
1414 if (!TestBinary(wk->li->list[0])) {
1415 wk->li->type = IDM_VIEWTEXT;
1416 goto SkipViewing;
1417 }
1418 else
1419 wk->li->type = IDM_VIEWBINARY;
1420 /* intentional fallthru */
1421 case IDM_VIEWBINARY:
1422 if (*binview) {
1423 ExecOnList((HWND) 0,
1424 binview,
1425 WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
1426 pszSrcFile, __LINE__);
1427 break;
1428 }
1429 /* else intentional fallthru */
1430 case IDM_VIEWTEXT:
1431 SkipViewing:
1432 if (*viewer)
1433 ExecOnList((HWND) 0, viewer,
1434 WINDOWED | SEPARATE |
1435 ((fViewChild) ? CHILD : 0),
1436 NULL, wk->li->list, NULL,
1437 pszSrcFile, __LINE__);
1438 else {
1439
1440 CHAR *temp;
1441 register INT x;
1442 ULONG viewtype;
1443
1444 viewtype = (wk->li->type == IDM_VIEWTEXT) ? 8 :
1445 (wk->li->type == IDM_VIEWBINARY) ? 16 : 0;
1446 for (x = 0; wk->li->list[x]; x++) {
1447 temp = xstrdup(wk->li->list[x], pszSrcFile, __LINE__);
1448 if (temp && WinIsWindow(hab2, wk->hwndCnr)) {
1449 if (!PostMsg(wk->hwndCnr,
1450 UM_LOADFILE,
1451 MPFROMLONG(5 + viewtype), MPFROMP(temp)))
1452 free(temp);
1453 }
1454 DosSleep(1);
1455 }
1456 }
1457 break;
1458
1459 case IDM_EDIT:
1460 if (!TestBinary(wk->li->list[0])) {
1461 wk->li->type = IDM_EDITTEXT;
1462 goto SkipEditing;
1463 }
1464 else
1465 wk->li->type = IDM_EDITBINARY;
1466 /* intentional fallthru */
1467 case IDM_EDITBINARY:
1468 if (*bined) {
1469 ExecOnList((HWND) 0,
1470 bined,
1471 WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
1472 pszSrcFile, __LINE__);
1473 break;
1474 }
1475 /* else intentional fallthru */
1476 case IDM_EDITTEXT:
1477 SkipEditing:
1478 if (*editor)
1479 ExecOnList((HWND) 0,
1480 editor,
1481 WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
1482 pszSrcFile, __LINE__);
1483 else {
1484
1485 CHAR *temp;
1486 register INT x;
1487 ULONG viewtype;
1488
1489 viewtype = (wk->li->type == IDM_EDITTEXT) ? 8 :
1490 (wk->li->type == IDM_EDITBINARY) ? 16 : 0;
1491 for (x = 0; wk->li->list[x]; x++) {
1492 temp = xstrdup(wk->li->list[x], pszSrcFile, __LINE__);
1493 if (temp && WinIsWindow(hab2, wk->hwndCnr)) {
1494 if (!PostMsg(wk->hwndCnr,
1495 UM_LOADFILE,
1496 MPFROMLONG(4 + viewtype), MPFROMP(temp)))
1497 free(temp);
1498 }
1499 DosSleep(1);
1500 }
1501 }
1502 break;
1503
1504 case IDM_SHADOW2:
1505 case IDM_OBJECT:
1506 case IDM_SHADOW:
1507 {
1508 CHAR objectpath[CCHMAXPATH];
1509 APIRET rc;
1510
1511 if (!*wk->li->targetpath || IsFile(wk->li->targetpath)) {
1512 GetDesktopName(objectpath, sizeof(objectpath));
1513 rc = WinDlgBox(HWND_DESKTOP,
1514 wk->hwndFrame,
1515 ObjCnrDlgProc,
1516 FM3ModHandle,
1517 OBJCNR_FRAME, MPFROMP(objectpath));
1518 if (rc) {
1519 if (rc > 1)
1520 strcpy(objectpath, "<WP_DESKTOP>");
1521 }
1522 else
1523 break;
1524 }
1525 else
1526 strcpy(objectpath, wk->li->targetpath);
1527 AddNote(GetPString(IDS_MAKINGOBJSTEXT));
1528 MakeShadows(wk->hwndFrame,
1529 wk->li->list,
1530 (wk->li->type == IDM_SHADOW) +
1531 (wk->li->type == IDM_SHADOW2) * 2,
1532 objectpath, NULL);
1533 AddNote(GetPString(IDS_MADEOBJSTEXT));
1534 }
1535 break;
1536
1537 case IDM_PRINT:
1538 if (WinDlgBox(HWND_DESKTOP,
1539 wk->hwndFrame,
1540 PrintDlgProc,
1541 FM3ModHandle, PRN_FRAME, MPFROMP(wk->li))) {
1542 if (wk->li && wk->li->list && wk->li->list[0]) {
1543 strcpy(wk->li->targetpath, printer);
1544 if (xbeginthread(PrintListThread,
1545 65536,
1546 wk->li,
1547 pszSrcFile,
1548 __LINE__) != -1)
1549 {
1550 wk->li = NULL; // prevent LISTINFO li from being freed here
1551 }
1552 }
1553 }
1554 break;
1555
1556 case IDM_ATTRS:
1557 if (WinDlgBox(HWND_DESKTOP,
1558 wk->hwndFrame,
1559 AttrListDlgProc,
1560 FM3ModHandle, ATR_FRAME, MPFROMP(wk->li))) {
1561 if (wk->li && wk->li->list && wk->li->list[0])
1562 Broadcast(hab2,
1563 wk->hwndCnr,
1564 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1565 }
1566 break;
1567
1568 case IDM_PERMDELETE:
1569 case IDM_DELETE:
1570 {
1571 CHECKLIST cl;
1572 INT isdir = 0, sysdir = 0, ro = 0, hs = 0;
1573 register INT x;
1574 FILESTATUS3 fsa;
1575 CHAR prompt[CCHMAXPATH * 3];
1576 APIRET error = 0;
1577 HOBJECT hObjectdest, hObjectofObject;
1578 BYTE G_abSupportedDrives[24] = {0};
1579 ULONG cbSupportedDrives = sizeof(G_abSupportedDrives);
1580
1581 for (x = 0; wk->li->list[x]; x++) {
1582 if (IsRoot(wk->li->list[x])) {
1583 wk->li->list = RemoveFromList(wk->li->list,
1584 wk->li->list[x]);
1585 if (!wk->li->list)
1586 break;
1587 x--;
1588 continue;
1589 }
1590 DosError(FERR_DISABLEHARDERR);
1591 if (DosQueryPathInfo(wk->li->list[x],
1592 FIL_STANDARD, &fsa,
1593 (ULONG) sizeof(FILESTATUS3))) {
1594 wk->li->list = RemoveFromList(wk->li->list,
1595 wk->li->list[x]);
1596 if (!wk->li->list)
1597 break;
1598 x--;
1599 continue;
1600 }
1601 if (fsa.attrFile & FILE_DIRECTORY) {
1602 isdir++;
1603 if (stristr(wk->li->list[x], ":\\OS2\\") ||
1604 !stricmp(wk->li->list[x] + 1, ":\\OS2"))
1605 sysdir++;
1606 }
1607 else {
1608 if (fsa.attrFile & (FILE_HIDDEN | FILE_SYSTEM))
1609 hs++;
1610 if (fsa.attrFile & FILE_READONLY)
1611 ro++;
1612 }
1613 }
1614 if (!wk->li->list)
1615 break;
1616 if (fConfirmDelete || isdir || hs || ro) {
1617 memset(&cl, 0, sizeof(cl));
1618 cl.size = sizeof(cl);
1619 cl.list = wk->li->list;
1620 cl.prompt = prompt;
1621 cl.flags |= CHECK_FILES;
1622 cl.cmd = wk->li->type;
1623 sprintf(prompt,
1624 GetPString(IDS_DELPROMPT1TEXT),
1625 (wk->li->type == IDM_DELETE) ?
1626 NullStr :
1627 GetPString(IDS_PERMANENTLYTEXT),
1628 &"s"[wk->li->list[1] == NULL]);
1629 if (isdir) {
1630 sprintf(&prompt[strlen(prompt)],
1631 GetPString(IDS_DELPROMPT2TEXT),
1632 isdir,
1633 (isdir > 1) ?
1634 GetPString(IDS_ARETEXT) :
1635 GetPString(IDS_ISTEXT),
1636 (isdir == 1) ?
1637 GetPString(IDS_ATEXT) :
1638 NullStr,
1639 (isdir > 1) ?
1640 GetPString(IDS_IESTEXT) : GetPString(IDS_YTEXT));
1641 if (sysdir)
1642 sprintf(&prompt[strlen(prompt)],
1643 GetPString(IDS_DELPROMPT3TEXT),
1644 sysdir,
1645 (sysdir == 1) ?
1646 GetPString(IDS_YTEXT) : GetPString(IDS_IESTEXT));
1647 }
1648 if (ro)
1649 sprintf(&prompt[strlen(prompt)],
1650 GetPString(IDS_DELPROMPT4TEXT),
1651 ro,
1652 &"s"[ro == 1],
1653 (ro > 1) ?
1654 GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
1655 if (hs)
1656 sprintf(&prompt[strlen(prompt)],
1657 GetPString(IDS_DELPROMPT5TEXT),
1658 hs,
1659 &"s"[hs == 1],
1660 (hs > 1) ?
1661 GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
1662 if ((ro || hs || sysdir) && !fAlertBeepOff)
1663 DosBeep(300, 100); // Wake up user
1664 strcat(prompt, GetPString(IDS_DELPROMPT6TEXT));
1665 error = WinDlgBox(HWND_DESKTOP,
1666 wk->hwndFrame,
1667 CheckListProc,
1668 FM3ModHandle, CHECK_FRAME, MPFROMP(&cl));
1669 if (!error || error == 65535)
1670 break;
1671 wk->li->list = cl.list;
1672 if (!wk->li->list || !wk->li->list[0])
1673 break;
1674 }
1675 if (fVerify && driveflags[toupper(*wk->li->list[0]) - 'A'] & DRIVE_WRITEVERIFYOFF)
1676 DosSetVerify(FALSE);
1677 DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY
1678 for (x = 0; wk->li->list[x]; x++) {
1679 fsa.attrFile = 0;
1680 DosError(FERR_DISABLEHARDERR);
1681 DosQueryPathInfo(wk->li->list[x],
1682 FIL_STANDARD,
1683 &fsa, (ULONG) sizeof(FILESTATUS3));
1684 if (fsa.attrFile & FILE_DIRECTORY) {
1685 error = (APIRET) wipeallf("%s%s*",
1686 wk->li->list[x],
1687 (*wk->li->list[x] &&
1688 wk->li->
1689 list[x][strlen(wk->li->list[x]) - 1]
1690 != '\\') ? PCSZ_BACKSLASH : NullStr);
1691 DosError(FERR_DISABLEHARDERR);
1692 if (!error)
1693 error = DosDeleteDir(wk->li->list[x]);
1694 else
1695 DosDeleteDir(wk->li->list[x]);
1696 }
1697 else {
1698
1699 DosError(FERR_DISABLEHARDERR);
1700 if (wk->li->type == IDM_DELETE) {
1701 hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
1702 PrfQueryProfileData(HINI_USER,
1703 "XWorkplace",
1704 "TrashCan::Drives",
1705 G_abSupportedDrives,
1706 &cbSupportedDrives);
1707 if (hObjectdest != NULLHANDLE && fTrashCan &&
1708 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] &
1709 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] &
1710 (DRIVE_REMOVABLE | DRIVE_IGNORE |
1711 DRIVE_REMOTE | DRIVE_VIRTUAL |
1712 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) {
1713 hObjectofObject = WinQueryObject(wk->li->list[x]);
1714 error = WinMoveObject(hObjectofObject, hObjectdest, 0);
1715 }
1716 else {
1717 error = DosDelete(wk->li->list[x]);
1718 }
1719 }
1720 else {
1721 error = DosForceDelete(wk->li->list[x]); ;
1722 }
1723 if (error) {
1724 DosError(FERR_DISABLEHARDERR);
1725 make_deleteable(wk->li->list[x]);
1726 if (wk->li->type == IDM_DELETE){
1727 hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
1728 PrfQueryProfileData(HINI_USER,
1729 "XWorkplace",
1730 "TrashCan::Drives",
1731 G_abSupportedDrives,
1732 &cbSupportedDrives);
1733 if (hObjectdest != NULLHANDLE && fTrashCan &&
1734 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] &
1735 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] &
1736 (DRIVE_REMOVABLE | DRIVE_IGNORE |
1737 DRIVE_REMOTE | DRIVE_VIRTUAL |
1738 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) {
1739 hObjectofObject = WinQueryObject(wk->li->list[x]);
1740 error = WinMoveObject(hObjectofObject, hObjectdest, 0);
1741 }
1742 else {
1743 error = DosDelete(wk->li->list[x]);
1744 }
1745 }
1746 else {
1747 error = DosForceDelete(wk->li->list[x]);
1748 }
1749 }
1750 DosReleaseMutexSem(hmtxFM2Delete);
1751 }
1752 if (error) {
1753 if (LogFileHandle)
1754 fprintf(LogFileHandle,
1755 GetPString(IDS_DELETEFAILED1TEXT),
1756 wk->li->list[x], error);
1757 if (Dos_Error(MB_ENTERCANCEL,
1758 error,
1759 wk->hwndFrame,
1760 pszSrcFile,
1761 __LINE__,
1762 GetPString(IDS_DELETEFAILED2TEXT),
1763 wk->li->list[x]) == MBID_CANCEL) {
1764 DosSetVerify(fVerify);
1765 break;
1766 }
1767 }
1768 else {
1769 if (LogFileHandle)
1770 fprintf(LogFileHandle,
1771 GetPString(IDS_DELETEDTEXT), wk->li->list[x]);
1772 sprintf(prompt,
1773 GetPString(IDS_DELETEDTEXT), wk->li->list[x]);
1774 AddNote(prompt);
1775 }
1776 if (//fSyncUpdates ||
1777 AddToList(wk->li->list[x], &files, &numfiles, &numalloc)) {
1778 Broadcast(hab2,
1779 wk->hwndCnr,
1780 UM_UPDATERECORD,
1781 MPFROMP(wk->li->list[x]), MPVOID);
1782 }
1783 } // for
1784 }
1785 if (fVerify)
1786 DosSetVerify(fVerify);
1787 break;
1788 } // switch
1789 if (files) {
1790 Broadcast(hab2,
1791 wk->hwndCnr,
1792 UM_UPDATERECORDLIST, MPFROMP(files), MPVOID);
1793 FreeList(files);
1794 }
1795 if (WinIsWindow(hab2, wk->hwndCnr))
1796 PostMsg(wk->hwndCnr, UM_RESCAN, MPVOID, MPVOID);
1797
1798 WinDestroyMsgQueue(hmq2);
1799 }
1800 DecrThreadUsage();
1801 WinTerminate(hab2);
1802 }
1803 }
1804 FreeListInfo(wk->li);
1805 free(wk);
1806# ifdef FORTIFY
1807 Fortify_LeaveScope();
1808# endif
1809 DosPostEventSem(CompactSem);
1810 }
1811}
1812
1813// We can use static buffer for all in progress actions because we have only 1 status line
1814static WORKER *pCachedActionWorker; // Sent from Action thread via UM_ACTIONSTATE
1815static PSZ pszCachedActionListItem; // Sent from Action thread via UM_ACTIONSTATE
1816
1817MRESULT EXPENTRY ActionWMTimer(HWND hwnd, MPARAM mp1, MPARAM mp2)
1818{
1819 if (pCachedActionWorker != NULL && pszCachedActionListItem != NULL) {
1820 DbgMsg(pszSrcFile, __LINE__, "Using hWndStatus %lx pCachedActionWorker %p pszCachedActionListItem %s", hwndStatus, pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug
1821 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd) {
1822 CHAR s[CCHMAXPATH + 64];
1823 sprintf(s, "%s %s",
1824 pCachedActionWorker->li->type == IDM_MOVE ?
1825 GetPString(IDS_MOVINGTEXT) :
1826 GetPString(IDS_COPYINGTEXT),
1827 pszCachedActionListItem);
1828 // sprintf(s, "Moving/copying %s", pszCachedActionListItem); // 14 Jul 09 SHL fixme
1829 WinSetWindowText(hwndStatus, s);
1830 }
1831 }
1832 return 0;
1833}
1834
1835MRESULT EXPENTRY ActionUMWorkerState(HWND hwnd, MPARAM mp1, MPARAM mp2) {
1836 pCachedActionWorker = PVOIDFROMMP(mp1);
1837 pszCachedActionListItem = PVOIDFROMMP(mp2);
1838 DbgMsg(pszSrcFile, __LINE__, "Setting pCachedActionWorker %p pszCachedActionListItem %s", pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug
1839 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd)
1840 WinPostMsg(hwnd, WM_SETFOCUS, MPFROMLONG(hwnd), MPFROMLONG(TRUE)); // 14 Jul 09 SHL Force status line update
1841 return 0;
1842}
1843
1844#pragma alloc_text(MASSACTION,MassAction)
1845#pragma alloc_text(ACTION,Action)
1846#pragma alloc_text(UNDO,FreeUndo,Undo)
Note: See TracBrowser for help on using the repository browser.