source: trunk/dll/datamin.c@ 1211

Last change on this file since 1211 was 1206, checked in by John Small, 17 years ago

Ticket 187: Move datadevlarations/definitions out of fm3dll.h

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 28.6 KB
RevLine 
[30]1
2/***********************************************************************
3
4 $Id: datamin.c 1206 2008-09-13 06:48:55Z jbs $
5
6 Minimized data bar
7
8 Copyright (c) 1993-98 M. Kimes
[346]9 Copyright (c) 2001, 2006 Steven H. Levine
[30]10
[130]11 14 Sep 02 SHL Handle large partitions
12 16 Oct 02 SHL Handle large partitions better
13 23 May 05 SHL Use QWL_USER
[136]14 23 May 05 SHL Avoid delays for inaccessible drives
[162]15 25 May 05 SHL Use ULONGLONG and CommaFmtULL
[204]16 06 Jun 05 SHL Drop unused code
[346]17 22 Jul 06 SHL Check more run time errors
[552]18 02 Jan 07 GKY Changed drive information string formating to accomodate 6 char FS names
19 07 Jan 07 GKY Move error strings etc. to string file
[593]20 30 Mar 07 GKY Remove GetPString for window class names
[793]21 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
[828]22 02 Sep 07 GKY Replaced DosQProcStatus with DosQuerySysState to fix trap in thunk code
[30]23
24***********************************************************************/
25
[907]26#include <string.h>
27#include <ctype.h>
28#include <limits.h>
29#include <process.h> // _beginthread
30
[2]31#define INCL_DOS
[136]32#define INCL_DOSERRORS
[2]33#define INCL_WIN
34#define INCL_GPI
[162]35#define INCL_LONGLONG
[2]36
[1178]37#include "fm3dll.h"
[1206]38#include "info.h" // Data declaration(s)
39#include "notebook.h" // Data declaration(s)
40#include "inis.h" // Data declaration(s)
41#include "init.h" // Data declaration(s)
42#include "defview.h" // Data declaration(s)
[2]43#include "fm3dlg.h"
44#include "fm3str.h"
45#include "procstat.h"
[136]46#include "datamin.h"
[907]47#include "errutil.h" // Dos_Error...
48#include "strutil.h" // GetPString
[1156]49#include "commafmt.h" // CommaFmtUL
50#include "killproc.h" // KillDlgProc
51#include "sysinfo.h" // SysInfoDlgProc
52#include "mainwnd.h" // TopWindowName
[1178]53#include "commafmt.h" // CommaFmtUL
54#include "common.h" // OpenDirCnr
55#include "shadow.h" // OpenObject
56#include "chklist.h" // PopupMenu
57#include "presparm.h" // SetPresParams
58#include "undel.h" // UndeleteDlgProc
59#include "misc.h" // GetCmdSpec
60#include "wrappers.h" // xDosFindFirst
61#include "systemf.h" // runemf2
[1038]62#include "fortify.h"
[2]63
[136]64APIRET16 APIENTRY16 Dos16MemAvail(PULONG pulAvailMem);
[2]65
[136]66static volatile HEV G_hevDataMin = NULLHANDLE;
67static volatile HWND G_hwndSingle = NULLHANDLE;
[2]68
[551]69static VOID dataminThread(VOID * pv);
[2]70
[1206]71// Data definitions
72#pragma data_seg(GLOBAL1)
73HWND DataHwnd;
74BOOL fDataInclRemote;
75BOOL fDataShowDrives;
76BOOL fDataToFore;
77BOOL fDullMin;
78
79#pragma data_seg(DATA2)
80
81static PSZ pszSrcFile = __FILE__;
82
[136]83long MINI_X = 208, MINI_Y = 16;
[2]84
[136]85//=== MiniTimeProc - time, swap and drive status mini windows procedure ===
[2]86
[136]87MRESULT EXPENTRY MiniTimeProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
88{
89 APIRET rc;
[551]90
91 switch (msg) {
[136]92 case WM_CREATE:
93 {
[551]94 PVOID pv = xmalloc(sizeof(tDataMin), pszSrcFile, __LINE__);
[959]95 if (pv)
96 WinSetWindowPtr(hwnd, QWL_DATAMIN_PTR, pv);
[136]97 }
98 break;
[2]99
[136]100 case WM_BUTTON1CLICK:
101 {
102 USHORT id = WinQueryWindowUShort(hwnd, QWS_ID);
103
[551]104 if (id >= MINI_DRIVEA) {
105 if (G_hevDataMin != NULLHANDLE) {
[136]106 G_hwndSingle = hwnd;
107 rc = DosPostEventSem(G_hevDataMin);
[551]108 if (rc) {
[552]109 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
110 GetPString(IDS_POSTSEMFAILED));
[136]111 }
112 }
113 }
114 else if (id == MINI_TIME)
[551]115 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_SETUP6, // Up time
116 MPVOID, MPVOID);
[136]117 else if (id == MINI_PROC)
118 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT),
[551]119 WM_SYSCOMMAND, MPFROM2SHORT(SC_TASKMANAGER, 0), MPVOID);
[136]120 }
121 break;
[2]122
[136]123 case WM_BUTTON1DBLCLK:
124 {
125 USHORT id = WinQueryWindowUShort(hwnd, QWS_ID);
[2]126
[551]127 if (id >= MINI_DRIVEA && !hwndMain) {
[136]128 CHAR s[] = " :\\";
[2]129
[136]130 *s = (CHAR) (id - MINI_DRIVEA) + 'A';
[551]131 OpenDirCnr((HWND) 0, HWND_DESKTOP, (HWND) 0, FALSE, s);
[136]132 return MRFROMLONG(1L);
133 }
[551]134 else if (id == MINI_TIME) {
[136]135 OpenObject("<WP_CLOCK>",
[551]136 (SHORT2FROMMP(mp2) & KC_SHIFT) ? Default : Settings, hwnd);
[136]137 return MRFROMLONG(1L);
138 }
[2]139
140#ifdef NEVER
[551]141 else if (id == MINI_MEM) {
[136]142 WinDlgBox(HWND_DESKTOP,
143 HWND_DESKTOP,
[551]144 SysInfoDlgProc, FM3ModHandle, SYS_FRAME, NULL);
[136]145 return MRFROMLONG(1L);
146 }
[2]147#endif
148
[551]149 else if (id == MINI_PROC || id == MINI_MEM) {
[136]150 WinDlgBox(HWND_DESKTOP,
[551]151 hwnd, KillDlgProc, FM3ModHandle, KILL_FRAME, NULL);
[136]152 return MRFROMLONG(1L);
153 }
[551]154 else if (id == MINI_SWAP && *SwapperDat) {
[2]155
[136]156 char s[5];
[2]157
[136]158 strncpy(s, SwapperDat, 4);
159 s[3] = 0;
160 WinDlgBox(HWND_DESKTOP,
161 hwndMain,
[551]162 UndeleteDlgProc, FM3ModHandle, UNDEL_FRAME, MPFROMP(s));
[136]163 return MRFROMLONG(1L);
[2]164 }
[136]165 }
166 break;
[2]167
[136]168 case WM_BUTTON1MOTIONSTART:
169 PostMsg(WinQueryWindow(hwnd, QW_PARENT),
[551]170 UM_BUTTON1MOTIONSTART, MPVOID, MPVOID);
[136]171 break;
[2]172
[136]173 case WM_CONTEXTMENU:
[551]174 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_CONTEXTMENU, MPVOID, MPVOID);
[136]175 break;
[2]176
[136]177 case WM_PAINT:
178 {
179 MRESULT mr = 0;
180 USHORT id;
181
182 id = WinQueryWindowUShort(hwnd, QWS_ID);
[551]183 if (id >= MINI_DRIVEA) {
[136]184 HPS hps = WinBeginPaint(hwnd, (HPS) 0, NULL);
[551]185
186 if (hps) {
[136]187 mr = WinSendMsg(WinQueryWindow(hwnd, QW_PARENT),
[551]188 UM_PAINT, MPFROM2SHORT(id, 0), MPFROMLONG(hps));
[136]189 WinEndPaint(hps);
[551]190 return mr; // Bypass default paint
[136]191 }
192 }
193 }
194 break;
[2]195
[551]196 case WM_DESTROY:
197 {
198 PVOID pv = WinQueryWindowPtr(hwnd, QWL_DATAMIN_PTR);
199
[1009]200 xfree(pv, pszSrcFile, __LINE__);
[551]201 }
202 break;
[2]203 }
[136]204 return PFNWPStatic(hwnd, msg, mp1, mp2);
[2]205
[551]206} // MiniTimeProc
[2]207
[136]208//=== DataProc - databar client window procedure ===
[2]209
[136]210MRESULT EXPENTRY DataProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
211{
212 APIRET rc;
213
[2]214 static ULONG counter;
[136]215 static BOOL NoFloat, noqproc = FALSE, Positioned;
[551]216 static HWND hwndMenu = (HWND) 0;
[2]217
[551]218 switch (msg) {
[136]219 case WM_CREATE:
[377]220 if (DataHwnd) {
[551]221 WinSetWindowPos(DataHwnd, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER | SWP_SHOW);
[136]222 return MRFROMLONG(1L);
223 }
224 DataHwnd = WinQueryWindow(hwnd, QW_PARENT);
225 NoFloat = FALSE;
226 Positioned = FALSE;
227 SetPresParams(hwnd,
[551]228 &RGBGREY, &RGBBLACK, &RGBBLACK, GetPString(IDS_8HELVTEXT));
[136]229 {
230 int c;
231 long x = 3;
[551]232 USHORT ids[] = { MINI_TIME, MINI_MEM, MINI_SWAP, MINI_PROC, 0 };
[136]233 POINTL aptl[TXTBOX_COUNT];
234 HPS hps;
235
236 hps = WinGetPS(hwnd);
[551]237 if (hps) {
[136]238 GpiQueryTextBox(hps,
239 34,
240 " -=03:08:22 SMW 1998/08/02=- ",
[551]241 TXTBOX_COUNT, aptl);
[136]242 WinReleasePS(hps);
243 MINI_X = aptl[TXTBOX_TOPRIGHT].x + 6;
244 MINI_Y = aptl[TXTBOX_TOPRIGHT].y + 6;
[2]245 }
[551]246 for (c = 0; ids[c]; c++) {
[377]247 if (!WinCreateWindow(hwnd,
[593]248 WC_MINITIME,
[551]249 NullStr,
250 SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE,
251 x,
252 3,
253 MINI_X,
254 MINI_Y, hwnd, HWND_TOP, ids[c], NULL, NULL)) {
255 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
[377]256 }
[136]257 x += (MINI_X + 4);
[2]258 }
[136]259 }
[551]260 if (!hwndMain) {
[136]261 SWCNTRL swctl;
[2]262
[136]263 memset(&swctl, 0, sizeof(swctl));
264 swctl.hwnd = WinQueryWindow(hwnd, QW_PARENT);
265 swctl.uchVisibility = SWL_VISIBLE;
266 swctl.fbJump = (fDataToFore) ? SWL_NOTJUMPABLE : SWL_JUMPABLE;
267 swctl.bProgType = PROG_PM;
[551]268 strcpy(swctl.szSwtitle, GetPString(IDS_DATABARTITLETEXT));
269 WinCreateSwitchEntry(WinQueryAnchorBlock(hwnd), &swctl);
[136]270 }
[551]271 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
[136]272 return 0;
[2]273
[136]274 case WM_MENUEND:
275 NoFloat = FALSE;
[551]276 if (hwndMenu == (HWND) mp2) {
[136]277 WinDestroyWindow(hwndMenu);
[551]278 hwndMenu = (HWND) 0;
[136]279 }
280 break;
281
282 case UM_RESTORE:
283 WinSetWindowPtr(hwnd, QWL_USER, mp1);
284 return 0;
285
286 case UM_SETUP:
287 {
288 long x, y;
289 SWP swp, swpD;
290 int c;
291 ULONG size = sizeof(SWP);
292 ULONG numdrives = 0;
293 ULONG drivestyle = (DRIVE_REMOVABLE | DRIVE_INVALID |
[553]294 DRIVE_IGNORE | DRIVE_ZIPSTREAM | DRIVE_NOSTATS);
[136]295 ULONG ulDriveNum, ulDriveMap;
296
297 if (!fDataInclRemote)
[553]298 drivestyle |= DRIVE_REMOTE || DRIVE_VIRTUAL || DRIVE_RAMDISK;
[551]299 if (fDataShowDrives) {
[136]300 DosError(FERR_DISABLEHARDERR);
301 DosQCurDisk(&ulDriveNum, &ulDriveMap);
302 x = 3;
303 y = MINI_Y + 4;
304 // Drive status windows
[551]305 for (c = 2; c < 26; c++) {
306 if ((ulDriveMap & (1L << c)) && !(driveflags[c] & drivestyle)) {
[377]307 if (!WinCreateWindow(hwnd,
[593]308 WC_MINITIME,
[551]309 NullStr,
310 SS_TEXT | DT_CENTER | DT_VCENTER |
311 WS_VISIBLE, x, y, MINI_X, MINI_Y, hwnd,
312 HWND_TOP, MINI_DRIVEA + c, NULL, NULL)) {
313 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__,
314 IDS_WINCREATEWINDOW);
[377]315 }
[136]316 numdrives++;
317 x += (MINI_X + 4);
[551]318 if ((numdrives % 4) == 0) {
[136]319 y += (MINI_Y + 4);
320 x = 3;
321 }
322 }
323 }
[2]324 }
[136]325 x = (MINI_X * 4) + 18;
326 y = (MINI_Y + 4) + ((numdrives / 4) * (MINI_Y + 4)) +
327 (((numdrives % 4) != 0) * (MINI_Y + 4));
[551]328 if (!Positioned) {
329 if (PrfQueryProfileData(fmprof, appname, "DataMinPos", &swp, &size)) {
[136]330 WinQueryWindowPos(HWND_DESKTOP, &swpD);
331 if (swp.x > swpD.cx - 16)
332 swp.x = swpD.cx - 16;
333 if (swp.y > swpD.cy - 16)
334 swp.y = swpD.cy - 16;
335 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT),
336 HWND_TOP,
337 swp.x,
338 swp.y,
[551]339 x, y, SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_ZORDER);
[136]340 }
341 else
342 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT),
343 HWND_TOP,
344 0,
345 0,
[551]346 x, y, SWP_SHOW | SWP_SIZE | SWP_MOVE | SWP_ZORDER);
[136]347 Positioned = TRUE;
348 }
349 else
350 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT),
351 HWND_TOP,
[551]352 0, 0, x, y, SWP_SHOW | SWP_SIZE | SWP_ZORDER);
353 WinShowWindow(WinQueryWindow(hwnd, QW_PARENT), TRUE);
[136]354 if (numdrives) {
[551]355 if (_beginthread(dataminThread, NULL, 32768, (PVOID) hwnd) == -1) {
356 Runtime_Error(pszSrcFile, __LINE__,
357 GetPString(IDS_COULDNTSTARTTHREADTEXT));
358 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
[136]359 }
360 }
361 counter = 0;
[551]362 PostMsg(hwnd, UM_TIMER, MPVOID, MPVOID);
[136]363 }
[551]364 return 0; // UM_SETUP
[136]365
366 case WM_BUTTON1DBLCLK:
367 if (hwndMain)
[551]368 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
[136]369 break;
370
371 case UM_CONTEXTMENU:
372 case WM_CONTEXTMENU:
373 if (!hwndMenu)
[551]374 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, MINI_FRAME);
375 if (hwndMenu) {
376 WinCheckMenuItem(hwndMenu, MINI_FLOAT, fDataToFore);
377 WinCheckMenuItem(hwndMenu, MINI_SHOW, fDataShowDrives);
378 WinCheckMenuItem(hwndMenu, MINI_BORING, fDullMin);
379 WinCheckMenuItem(hwndMenu, MINI_INCLREMOTE, fDataInclRemote);
[136]380 NoFloat = TRUE;
[551]381 if (!PopupMenu(hwnd, hwnd, hwndMenu))
[136]382 NoFloat = FALSE;
383 }
384 if (msg == UM_CONTEXTMENU)
[2]385 return 0;
[136]386 break;
[2]387
[136]388 case WM_BUTTON2DBLCLK:
[551]389 if (!(SHORT2FROMMP(mp2) & KC_SHIFT)) {
390 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(MINI_FLOAT, 0), MPVOID);
[2]391 break;
[136]392 }
393 /* else intentional fallthru */
394 case WM_CHORD:
395 case WM_BUTTON3DBLCLK:
[551]396 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(MINI_SHOW, 0), MPVOID);
[136]397 break;
[2]398
[136]399 case UM_BUTTON1MOTIONSTART:
400 case WM_BUTTON1MOTIONSTART:
401 {
402 TRACKINFO TrackInfo;
403 SWP Position;
[2]404
[136]405 memset(&TrackInfo, 0, sizeof(TrackInfo));
406 TrackInfo.cxBorder = 1;
407 TrackInfo.cyBorder = 1;
408 TrackInfo.cxGrid = 1;
409 TrackInfo.cyGrid = 1;
410 TrackInfo.cxKeyboard = 8;
411 TrackInfo.cyKeyboard = 8;
412 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &Position);
413 TrackInfo.rclTrack.xLeft = Position.x;
414 TrackInfo.rclTrack.xRight = Position.x + Position.cx;
415 TrackInfo.rclTrack.yBottom = Position.y;
416 TrackInfo.rclTrack.yTop = Position.y + Position.cy;
417 WinQueryWindowPos(HWND_DESKTOP, &Position);
418 TrackInfo.rclBoundary.xLeft = Position.x;
419 TrackInfo.rclBoundary.xRight = Position.x + Position.cx;
420 TrackInfo.rclBoundary.yBottom = Position.y;
421 TrackInfo.rclBoundary.yTop = Position.y + Position.cy;
422 TrackInfo.ptlMinTrackSize.x = 0;
423 TrackInfo.ptlMinTrackSize.y = 0;
424 TrackInfo.ptlMaxTrackSize.x = Position.cx;
425 TrackInfo.ptlMaxTrackSize.y = Position.cy;
426 TrackInfo.fs = TF_MOVE | TF_STANDARD | TF_ALLINBOUNDARY;
[551]427 if (WinTrackRect(HWND_DESKTOP, (HPS) 0, &TrackInfo)) {
[136]428 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT),
429 HWND_TOP, TrackInfo.rclTrack.xLeft,
430 TrackInfo.rclTrack.yBottom, 0, 0, SWP_MOVE);
431 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID);
432 }
433 }
434 break;
[2]435
[136]436 case WM_HELP:
437 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID);
438 break;
439
440 case WM_COMMAND:
[551]441 switch (SHORT1FROMMP(mp1)) {
[136]442 case IDM_COMMANDLINE:
443 case IDM_DOSCOMMANDLINE:
444 case IDM_WINFULLSCREEN:
445 {
446 CHAR *env = GetCmdSpec(FALSE), path[CCHMAXPATH];
447 INT type = SEPARATE | WINDOWED;
448
449 *path = 0;
[551]450 TopWindowName(hwnd, (HWND) 0, path);
[136]451 if (SHORT1FROMMP(mp1) == IDM_DOSCOMMANDLINE)
452 env = GetCmdSpec(TRUE);
[551]453 else if (SHORT1FROMMP(mp1) != IDM_COMMANDLINE) {
[136]454 env = "WINOS2.COM";
455 type = SEPARATE | FULLSCREEN;
456 }
[888]457 runemf2(type, hwnd, pszSrcFile, __LINE__,
458 path, NULL, "%s", env);
[2]459 }
[136]460 break;
[2]461
[136]462 case IDM_HELP:
463 if (hwndHelp)
464 WinSendMsg(hwndHelp,
465 HM_DISPLAY_HELP,
[551]466 MPFROM2SHORT(HELP_DATABAR, 0), MPFROMSHORT(HM_RESOURCEID));
[2]467 break;
468
[136]469 case MINI_CLOSE:
[551]470 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
[2]471 break;
472
[136]473 case MINI_BORING:
474 fDullMin = (fDullMin) ? FALSE : TRUE;
475 PrfWriteProfileData(fmprof,
[551]476 FM3Str, "DullDatabar", &fDullMin, sizeof(BOOL));
477 if (G_hevDataMin != NULLHANDLE) {
[136]478 rc = DosPostEventSem(G_hevDataMin);
479 if (rc) {
[552]480 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
481 GetPString(IDS_POSTSEMFAILED));
[136]482 }
[2]483 }
[136]484
[2]485 break;
486
[136]487 case MINI_INCLREMOTE:
488 case MINI_SHOW:
[551]489 if (SHORT1FROMMP(mp1) == MINI_SHOW) {
[136]490 fDataShowDrives = (fDataShowDrives) ? FALSE : TRUE;
491 PrfWriteProfileData(fmprof,
492 appname,
[551]493 "DataShowDrives", &fDataShowDrives, sizeof(BOOL));
[136]494 }
[551]495 else {
[136]496 fDataInclRemote = (fDataInclRemote) ? FALSE : TRUE;
497 PrfWriteProfileData(fmprof,
498 appname,
[551]499 "DataInclRemote", &fDataInclRemote, sizeof(BOOL));
[136]500 }
501 {
502 HENUM henum;
503 HWND hwndChild;
504 USHORT id;
[2]505
[136]506 henum = WinBeginEnumWindows(hwnd);
[551]507 while ((hwndChild = WinGetNextWindow(henum)) != NULLHANDLE) {
[136]508 id = WinQueryWindowUShort(hwndChild, QWS_ID);
509 if (id >= MINI_DRIVEA)
510 WinDestroyWindow(hwndChild);
511 }
512 WinEndEnumWindows(henum);
[2]513 }
[136]514 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
[2]515 break;
516
[136]517 case MINI_FLOAT:
518 fDataToFore = (fDataToFore) ? FALSE : TRUE;
519 PrfWriteProfileData(fmprof,
[551]520 appname, "DataToFore", &fDataToFore, sizeof(BOOL));
521 if (!hwndMain) {
[136]522
523 SWCNTRL swcntrl;
524 HSWITCH hswitch;
525
526 hswitch = (HSWITCH) WinQuerySwitchHandle(hwnd, (PID) 0);
[551]527 if (hswitch) {
[136]528 memset(&swcntrl, 0, sizeof(SWCNTRL));
[551]529 if (!WinQuerySwitchEntry(hswitch, &swcntrl)) {
[136]530 swcntrl.fbJump = (fDataToFore) ? SWL_NOTJUMPABLE : SWL_JUMPABLE;
[551]531 WinChangeSwitchEntry(hswitch, &swcntrl);
[136]532 }
533 }
534 }
[2]535 break;
[136]536 }
537 return 0;
[2]538
[136]539 case WM_SIZE:
540 WinSetWindowPos(hwnd,
541 HWND_TOP,
542 0,
543 0,
544 SHORT1FROMMP(mp2),
[551]545 SHORT2FROMMP(mp2), SWP_MOVE | SWP_SIZE);
[136]546 break;
[2]547
[136]548 case WM_PAINT:
549 {
550 HPS hps;
551 POINTL ptl;
552 SWP swp;
553 RECTL rcl;
[2]554
[551]555 hps = WinBeginPaint(hwnd, (HPS) 0, &rcl);
556 if (hps) {
557 WinFillRect(hps, (PRECTL) & rcl, CLR_PALEGRAY);
[136]558 GpiSetMix(hps, FM_OVERPAINT);
559 GpiSetColor(hps, CLR_WHITE);
560 WinQueryWindowPos(hwnd, &swp);
561 ptl.x = 0;
562 ptl.y = 0;
563 GpiMove(hps, &ptl);
564 ptl.y = swp.cy - 1;
565 GpiLine(hps, &ptl);
566 ptl.x = swp.cx - 1;
567 GpiLine(hps, &ptl);
568 GpiSetColor(hps, CLR_DARKGRAY);
569 ptl.y = 0;
570 GpiLine(hps, &ptl);
571 ptl.x = 0;
572 GpiLine(hps, &ptl);
573 {
574 HENUM henum;
575 HWND hwndTemp;
[2]576
[136]577 henum = WinBeginEnumWindows(hwnd);
[551]578 while ((hwndTemp = WinGetNextWindow(henum)) != NULLHANDLE) {
[136]579 PaintRecessedWindow(hwndTemp,
[551]580 hps, (WinQueryWindowUShort(hwndTemp, QWS_ID)
581 != MINI_TIME), FALSE);
[136]582 }
583 WinEndEnumWindows(henum);
584 }
585 WinEndPaint(hps);
586 }
587 }
588 return 0;
[2]589
[136]590 case UM_PAINT:
591 {
592 CHAR s[90];
593 CHAR szFreeQty[38];
594 CHAR szDrvLtr[] = " :";
595 CHAR *pszFSystem;
[162]596 ULONGLONG ullFreeQty;
[136]597 ULONG ulPercentFree;
598 ULONG wasx;
599 HPS hps = (HPS) mp2;
600 HWND hwndChild;
601 USHORT id;
602 SWP swp;
603 POINTL ptl;
604 tDataMin *pDM;
[2]605
[136]606 id = SHORT1FROMMP(mp1);
[551]607 if (id >= MINI_DRIVEA) {
[136]608 hwndChild = WinWindowFromID(hwnd, id);
609 if (!hwndChild)
610 return 0;
611 if (!WinQueryWindowPos(hwndChild, &swp))
612 return 0;
613 pDM = WinQueryWindowPtr(hwndChild, QWL_DATAMIN_PTR);
[551]614 if (!pDM || pDM->qfsi_rc) {
[162]615 ullFreeQty = 0;
[136]616 ulPercentFree = 0;
617 }
[551]618 else {
619 ullFreeQty = (ULONGLONG) pDM->fsa.cUnitAvail *
620 (pDM->fsa.cSectorUnit * pDM->fsa.cbSector);
[2]621
[551]622 ulPercentFree = (pDM->fsa.cUnit && pDM->fsa.cUnitAvail) ?
623 (pDM->fsa.cUnitAvail * 100) / pDM->fsa.cUnit : 0;
[136]624 }
[2]625
[551]626 CommaFmtULL(szFreeQty, sizeof(szFreeQty), ullFreeQty, ' ');
627 *szDrvLtr = (CHAR) (id - MINI_DRIVEA) + 'A';
[2]628
[551]629 if (!pDM || pDM->qfsi_rc || pDM->qfsa_rc)
[136]630 pszFSystem = "N/A";
[551]631 else {
[689]632 pszFSystem = (PCHAR)(pDM->fsqb2.szName) + pDM->fsqb2.cbName + 1;
[136]633 pszFSystem[15] = 0;
634 }
635 sprintf(s,
[549]636 "%s %13s %lu%%-%s %6s ",
[136]637 szDrvLtr,
638 szFreeQty,
[551]639 ulPercentFree, GetPString(IDS_FREETEXT), pszFSystem);
[136]640 if (!hps)
641 hps = WinGetPS(hwndChild);
[551]642 if (hps) {
643 if (!fDullMin) {
[136]644 ptl.x = 0;
645 ptl.y = 0;
[551]646 GpiMove(hps, &ptl);
647 GpiSetColor(hps, CLR_BLACK);
[136]648 ptl.x = swp.cx - 1;
649 ptl.y = swp.cy - 1;
[551]650 GpiBox(hps, DRO_OUTLINE, &ptl, 0, 0);
[136]651 ptl.x = 1;
652 ptl.y = 1;
[551]653 if (ulPercentFree) {
[136]654 GpiMove(hps, &ptl);
655 GpiSetColor(hps,
656 (ulPercentFree < 11) ? CLR_DARKRED :
657 (ulPercentFree < 26) ? CLR_DARKBLUE :
658 CLR_DARKGREEN);
659 ptl.y = swp.cy - 2;
660 ptl.x = ((swp.cx - 2) * ulPercentFree) / 100;
661 wasx = ptl.x;
[551]662 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0);
[136]663 GpiSetColor(hps,
664 (ulPercentFree < 11) ? CLR_RED :
665 (ulPercentFree < 26) ? CLR_BLUE : CLR_GREEN);
666 ptl.x = wasx;
667 ptl.y = swp.cy - 2;
[551]668 GpiMove(hps, &ptl);
[136]669 ptl.x = 1;
[551]670 GpiLine(hps, &ptl);
[136]671 ptl.y = 2;
672 ptl.x = 1;
[551]673 GpiLine(hps, &ptl);
[136]674 ptl.x = wasx;
675 }
[551]676 if (ulPercentFree < 99) {
677 GpiSetColor(hps, CLR_DARKGRAY);
[136]678 wasx = ptl.x;
679 ptl.y = 2;
680 GpiMove(hps, &ptl);
681 ptl.y = swp.cy - 2;
682 ptl.x = swp.cx - 2;
[551]683 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0);
[136]684 ptl.x = wasx;
[551]685 GpiMove(hps, &ptl);
686 GpiSetColor(hps, CLR_PALEGRAY);
[136]687 ptl.x = swp.cx - 3;
688 GpiLine(hps, &ptl);
689 ptl.x = wasx;
690 ptl.y = 1;
691 GpiMove(hps, &ptl);
[551]692 GpiSetColor(hps, CLR_BLACK);
[136]693 ptl.x = swp.cx - 2;
694 GpiLine(hps, &ptl);
695 ptl.y = swp.cy - 3;
696 GpiLine(hps, &ptl);
697 }
[551]698 GpiSetColor(hps, CLR_WHITE);
[136]699 }
[551]700 else {
701 GpiSetColor(hps, CLR_PALEGRAY);
[136]702 ptl.x = 0;
703 ptl.y = 0;
[551]704 GpiMove(hps, &ptl);
[136]705 ptl.x = swp.cx - 1;
706 ptl.y = swp.cy - 1;
[551]707 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0);
[136]708 GpiSetColor(hps,
[551]709 (ulPercentFree < 11) ? CLR_DARKRED : CLR_DARKBLUE);
[136]710 }
[551]711 GpiSetBackMix(hps, BM_LEAVEALONE);
712 GpiSetMix(hps, FM_OVERPAINT);
[136]713 {
714 POINTL aptl[TXTBOX_COUNT];
[2]715
[551]716 GpiQueryTextBox(hps, strlen(s), s, TXTBOX_COUNT, aptl);
[136]717 ptl.y = ((swp.cy / 2) -
718 ((aptl[TXTBOX_TOPRIGHT].y +
719 aptl[TXTBOX_BOTTOMLEFT].y) / 2));
720 ptl.y++;
721 ptl.x = (swp.cx / 2) - (aptl[TXTBOX_TOPRIGHT].x / 2);
722 if (ptl.x < 2)
723 ptl.x = 2;
[551]724 GpiCharStringAt(hps, &ptl, strlen(s), s);
[136]725 }
726 if (!mp2)
727 WinReleasePS(hps);
728 }
[551]729 } // if drive window
[136]730 }
731 return 0;
732
733 case UM_TIMER:
734 {
735 CHAR s[134];
736 DATETIME dt;
737
738 if (fDataToFore && !NoFloat)
739 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT),
740 HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
[551]741 if (counter && (counter % 19) && (counter % 20)) {
742 if (!DosGetDateTime(&dt)) {
[136]743 sprintf(s,
744 " %02hu:%02hu:%02hu %s %04u/%02u/%02u",
745 dt.hours,
746 dt.minutes,
747 dt.seconds,
748 GetPString(IDS_SUNDAY + dt.weekday),
[551]749 dt.year, dt.month, dt.day);
750 WinSetDlgItemText(hwnd, MINI_TIME, s);
[136]751 }
[2]752 }
[136]753 else if (!counter || !(counter % 19))
754 PostMsg(hwnd, UM_SETUP6, MPVOID, MPVOID); // Uptime
[551]755 if (!(counter % 4)) {
[136]756 PostMsg(hwnd, UM_SETUP3, MPVOID, MPVOID); // Memory utilization
[551]757 if (!(counter % 10)) {
[136]758 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); // Process status
[551]759 if (!(counter % 20)) {
[136]760 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); // Swapper
761 }
762 }
763 }
764 }
765 counter++;
766 return 0;
[2]767
[136]768 case UM_SETUP2:
769 {
[204]770 CHAR s[134], szFileQty[38], szFreeQty[38];
[841]771 FILEFINDBUF3L ffb;
[761]772 ULONG nm = 1;
[162]773 ULONGLONG ullFreeQty;
[136]774 HDIR hdir = HDIR_CREATE;
775 FSALLOCATE fsa;
[2]776
[551]777 if (*SwapperDat) {
[136]778 DosError(FERR_DISABLEHARDERR);
[838]779 if (!xDosFindFirst(SwapperDat, &hdir, FILE_NORMAL | FILE_HIDDEN |
780 FILE_SYSTEM | FILE_ARCHIVED | FILE_READONLY,
[841]781 &ffb, sizeof(ffb), &nm, FIL_STANDARDL)) {
[136]782 priority_bumped();
783 DosFindClose(hdir);
784 DosError(FERR_DISABLEHARDERR);
785 if (!DosQueryFSInfo(toupper(*SwapperDat) - '@', FSIL_ALLOC,
[551]786 &fsa, sizeof(FSALLOCATE))) {
787 ullFreeQty =
788 (ULONGLONG) fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector);
789 CommaFmtULL(szFreeQty, sizeof(szFreeQty), ullFreeQty, ' ');
[136]790 }
791 else
[162]792 *szFreeQty = 0;
793
[551]794 CommaFmtULL(szFileQty, sizeof(szFileQty), ffb.cbFile, ' ');
[162]795 sprintf(s, " %s %s%s%s",
[136]796 GetPString(IDS_SWAPTITLETEXT),
[551]797 szFileQty, *szFreeQty ? "/" : NullStr, szFreeQty);
798 WinSetDlgItemText(hwnd, MINI_SWAP, s);
[136]799 }
800 }
801 }
802 return 0;
[2]803
[136]804 case UM_SETUP3: // Memory utilization
805 {
[162]806 CHAR s[134], tm[38], szQty[38];
[136]807 ULONG amem = 0;
[2]808
[136]809 if (!DosQuerySysInfo(QSV_TOTAVAILMEM, QSV_TOTAVAILMEM,
[551]810 (PVOID) & amem, (ULONG) sizeof(amem))) {
811 CommaFmtUL(tm, sizeof(tm), amem, 'M');
[162]812 if (!Dos16MemAvail(&amem))
[551]813 CommaFmtUL(szQty, sizeof(szQty), amem, 'M');
[136]814 else
[162]815 *szQty = 0;
816 sprintf(s, " %s%s%s%s",
[136]817 GetPString(IDS_MEMTITLETEXT),
[551]818 szQty, (*szQty) ? "/" : NullStr, tm);
819 WinSetDlgItemText(hwnd, MINI_MEM, s);
[2]820 }
[136]821 }
822 return 0;
[2]823
[551]824 case UM_SETUP5: // Process status
[136]825 {
[828]826 CHAR s[134], tm[38], szQty[38];
[136]827
[828]828 if (fUseQProcStat && !noqproc) {
[2]829
[136]830 PROCESSINFO *ppi;
831 BUFFHEADER *pbh = NULL;
832 MODINFO *pmi;
833 ULONG numprocs = 0, numthreads = 0;
[346]834 APIRET rc;
[136]835
[829]836 rc = DosAllocMem((PVOID)&pbh, USHRT_MAX + 4096,
[551]837 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
[346]838 if (rc)
[551]839 Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__,
840 GetPString(IDS_OUTOFMEMORY));
841 else {
[829]842 if (DosQProcStatus((ULONG *)pbh, USHRT_MAX))
[346]843 noqproc = TRUE;
844 else {
[551]845 ppi = pbh->ppi;
846 while (ppi->ulEndIndicator != PROCESS_END_INDICATOR) {
847 pmi = pbh->pmi;
848 while (pmi && ppi->hModRef != pmi->hMod)
849 pmi = pmi->pNext;
850 if (pmi) {
[136]851 numprocs++;
[551]852 numthreads += ppi->usThreadCount;
[136]853 }
[551]854 ppi = (PPROCESSINFO) (ppi->ptiFirst + ppi->usThreadCount);
[36]855 }
[136]856 commafmt(szQty, sizeof(szQty), numprocs);
857 commafmt(tm, sizeof(tm), numthreads);
858 sprintf(s,
859 " %s%s %s%s",
860 GetPString(IDS_PROCSTITLETEXT),
[551]861 szQty, GetPString(IDS_THRDSTITLETEXT), tm);
862 WinSetDlgItemText(hwnd, MINI_PROC, s);
[136]863 }
864 DosFreeMem(pbh);
865 }
[2]866 }
[828]867 else if (fUseQSysState && !noqproc) {
868
869 QSPREC *ppi;
870 QSPTRREC *pbh = NULL;
871 QSLREC *pmi;
872 ULONG numprocs = 0, numthreads = 0;
873 APIRET rc;
874
875 rc = DosAllocMem((PVOID) & pbh, USHRT_MAX + 4096,
876 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
877 if (rc)
878 Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__,
879 GetPString(IDS_OUTOFMEMORY));
880 else { //2 Sep 07 GKY 0x05 = process & Mod data only
881 if (DosQuerySysState(QS_PROCESS | QS_MTE, 0, 0, 0, pbh, USHRT_MAX))
882 noqproc = TRUE;
883 else {
884 ppi = pbh->pProcRec;
885 while (ppi->RecType == 1) {
886 pmi = pbh->pLibRec;
887 while (pmi && ppi->hMte != pmi->hmte)
888 pmi = pmi->pNextRec;
889 if (pmi) {
890 numprocs++;
891 numthreads += ppi->cTCB;
892 }
893 ppi = (QSPREC *) (ppi->pThrdRec + ppi->cTCB);
894 }
895 commafmt(szQty, sizeof(szQty), numprocs);
896 commafmt(tm, sizeof(tm), numthreads);
897 sprintf(s,
898 " %s%s %s%s",
899 GetPString(IDS_PROCSTITLETEXT),
900 szQty, GetPString(IDS_THRDSTITLETEXT), tm);
901 WinSetDlgItemText(hwnd, MINI_PROC, s);
902 }
903 DosFreeMem(pbh);
904 }
905 }
[551]906 else {
[136]907 commafmt(szQty, sizeof(szQty),
[551]908 WinQuerySwitchList(WinQueryAnchorBlock(hwnd), (PSWBLOCK) 0,
909 0));
910 sprintf(s, " %s%s", GetPString(IDS_TASKSTITLETEXT), szQty);
911 WinSetDlgItemText(hwnd, MINI_PROC, s);
[2]912 }
[136]913 }
914 return 0;
[2]915
[136]916 case UM_SETUP6: // Uptime
917 {
918 ULONG val = 0, numdays, nummins;
919 CHAR s[128];
920
921 if (!DosQuerySysInfo(QSV_MS_COUNT,
922 QSV_MS_COUNT,
[551]923 (PVOID) & val, (ULONG) sizeof(val))) {
[136]924 val /= 60000L;
925 numdays = val / (60L * 24L);
926 strcpy(s, GetPString(IDS_ELAPSEDTITLETEXT));
927 if (numdays)
928 sprintf(s + strlen(s),
929 " %lu %s%s, ",
[551]930 numdays, GetPString(IDS_DAYTEXT), &"s"[numdays == 1L]);
[136]931 nummins = val % (60L * 24L);
[551]932 sprintf(s + strlen(s), " %lu:%02lu", nummins / 60, nummins % 60);
933 WinSetDlgItemText(hwnd, MINI_TIME, s);
[2]934 }
[136]935 }
936 return 0;
[2]937
[136]938 case WM_SAVEAPPLICATION:
939 {
940 SWP swp;
[2]941
[136]942 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp);
[551]943 PrfWriteProfileData(fmprof, appname, "DataMinPos", &swp, sizeof(SWP));
[136]944 }
945 break;
[2]946
[136]947 case WM_CLOSE:
[551]948 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID);
[136]949 WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT));
950 return 0;
[2]951
[136]952 case WM_DESTROY:
[551]953 if (DataHwnd == WinQueryWindow(hwnd, QW_PARENT)) {
954 DataHwnd = (HWND) 0;
[136]955 if (hwndMenu)
956 WinDestroyWindow(hwndMenu);
[551]957 hwndMenu = (HWND) 0;
[136]958 }
[551]959 if (hwndMain) {
[2]960
[136]961 SWP swp;
962 ULONG fl = SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE, ofl;
[2]963
[136]964 ofl = WinQueryWindowULong(hwnd, QWL_USER);
965 WinQueryWindowPos(WinQueryWindow(hwndMain, QW_PARENT), &swp);
966 if (swp.fl & SWP_MINIMIZE)
967 fl |= ((ofl & SWP_MAXIMIZE) ? SWP_MAXIMIZE : SWP_RESTORE);
968 WinSetWindowPos(WinQueryWindow(hwndMain, QW_PARENT),
[551]969 HWND_TOP, 0, 0, 0, 0, fl);
[136]970 }
[551]971 else if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID))
972 WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
[136]973 break;
974 }
975 return WinDefWindowProc(hwnd, msg, mp1, mp2);
[2]976
[551]977} // DataProc
[2]978
[136]979//=== CreateDataBar - create databar windows ===
[2]980
[136]981HWND CreateDataBar(HWND hwndParent, ULONG fl)
982{
[551]983 HWND hwndClient = (HWND) 0;
[136]984 ULONG FrameFlags = 0;
[2]985
[136]986 if (WinCreateStdWindow(hwndParent,
987 WS_VISIBLE,
988 &FrameFlags,
[593]989 WC_DATABAR,
[551]990 NULL, WS_VISIBLE, 0, MINI_FRAME, &hwndClient)) {
991 WinSendMsg(hwndClient, UM_RESTORE, MPFROMLONG(fl), MPVOID);
[136]992 }
993 return hwndClient;
[2]994
[551]995} // CreateDataBar
[2]996
[136]997//=== dataminThread - drive status thread ===
[2]998
[551]999static VOID dataminThread(VOID * pv)
[136]1000{
[551]1001 HAB hab = NULLHANDLE;
1002 HMQ hmq = NULLHANDLE;
1003 HWND hwndParent = (HWND) pv;
1004 HWND hwnd;
1005 HENUM henum;
[136]1006 BOOL busy = TRUE;
1007 APIRET rc;
1008 USHORT id;
1009
[1038]1010# ifdef FORTIFY
1011 Fortify_EnterScope();
[1063]1012# endif
[551]1013 if (G_hevDataMin == NULLHANDLE) {
[136]1014 // Create just once for any thread that might use it
1015 // Kernel will clean up on exit
[551]1016 rc = DosCreateEventSem(NULL, (PHEV) & G_hevDataMin, 0L, FALSE);
[136]1017 if (rc) {
[552]1018 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
1019 GetPString(IDS_CREATESEMFAILED));
[136]1020 busy = FALSE;
1021 }
1022 }
1023
[179]1024 // fixme to report errors
[136]1025 hab = WinInitialize(0);
1026 if (hab == NULLHANDLE)
1027 busy = FALSE;
[551]1028 else {
1029 hmq = WinCreateMsgQueue(hab, 0);
[136]1030 if (hmq == NULLHANDLE)
1031 busy = FALSE;
1032 else
[551]1033 WinCancelShutdown(hmq, TRUE);
[136]1034 }
1035
[551]1036 while (busy) {
[136]1037 HWND hwndSingle = G_hwndSingle;
[551]1038
[136]1039 G_hwndSingle = NULLHANDLE;
1040
1041 busy = FALSE;
1042
[551]1043 if (!WinIsWindow(hab, hwndParent))
[2]1044 break;
1045
[136]1046 henum = WinBeginEnumWindows(hwndParent);
[551]1047 while (henum && (hwnd = WinGetNextWindow(henum)) != NULLHANDLE) {
1048 if (!WinIsWindow(hab, hwnd))
[136]1049 continue;
1050 if (hwndSingle && hwndSingle != hwnd)
1051 continue;
[551]1052 id = WinQueryWindowUShort(hwnd, QWS_ID);
1053 if (id > MINI_DRIVEA) {
[136]1054 ULONG dskNum = id - MINI_DRIVEA + 1;
1055 tDataMin *pDM = WinQueryWindowPtr(hwnd, QWL_DATAMIN_PTR);
1056 SWP swp;
1057 CHAR szPath[] = " :";
[551]1058
[136]1059 if (!pDM)
1060 continue;
1061 busy = TRUE;
1062 if (!WinQueryWindowPos(hwnd, &swp))
1063 continue;
[2]1064
[136]1065 DosError(FERR_DISABLEHARDERR);
[551]1066 pDM->qfsi_rc = DosQueryFSInfo(dskNum,
1067 FSIL_ALLOC,
1068 &pDM->fsa, sizeof(FSALLOCATE));
[2]1069
[551]1070 if (!pDM->qfsi_rc) {
[136]1071 *szPath = (CHAR) dskNum + 'A' - 1;
[551]1072 pDM->qfsa_cb = sizeof(FSQBUFFER2) + 256; // se tDataMin
[136]1073 DosError(FERR_DISABLEHARDERR);
[551]1074 pDM->qfsa_rc = DosQueryFSAttach(szPath, 0, /* Ordinal */
1075 FSAIL_QUERYNAME,
1076 &pDM->fsqb2, &pDM->qfsa_cb);
[136]1077 }
1078 WinInvalidateRect(hwnd, NULL, FALSE);
[551]1079 } // if drive window
1080 } // while henum
[136]1081 WinEndEnumWindows(henum);
[2]1082
[551]1083 if (busy) {
[136]1084 ULONG clPosted;
[551]1085
1086 rc = DosWaitEventSem(G_hevDataMin, 20000L);
1087 if (rc && rc != ERROR_TIMEOUT) {
[552]1088 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
1089 GetPString(IDS_POSTSEMFAILED));
[2]1090 }
1091
[551]1092 rc = DosResetEventSem(G_hevDataMin, &clPosted);
1093 if (rc && rc != ERROR_ALREADY_RESET) {
[552]1094 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
1095 GetPString(IDS_POSTSEMFAILED));
[136]1096 }
1097 }
[2]1098
[551]1099 } // while
[2]1100
[136]1101 if (hmq != NULLHANDLE)
1102 WinDestroyMsgQueue(hmq);
[2]1103
[136]1104 if (hab != NULLHANDLE)
1105 WinTerminate(hab);
[1063]1106# ifdef FORTIFY
[1038]1107 Fortify_LeaveScope();
[1063]1108# endif
[551]1109} // dataminThread
[793]1110
1111#pragma alloc_text(DATAMIN,DataDlgProc,MiniTimeProc)
Note: See TracBrowser for help on using the repository browser.