source: trunk/dll/init.c@ 798

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

Make subject column in dircnrs movable from one pane to the other; allow column to be sized truncating long subjects

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 45.5 KB
RevLine 
[32]1
2/***********************************************************************
3
4 $Id: init.c 796 2007-08-21 23:22:27Z gyoung $
5
6 Initialization
7
8 Copyright (c) 1993-98 M. Kimes
[627]9 Copyright (c) 2001, 2007 Steven H. Levine
[32]10
[133]11 11 Jun 02 SHL Add CheckVersion
12 11 Jun 03 SHL Add JFS and FAT32 support
13 25 Nov 03 SHL InitFM3DLL: correct strings error mesage
14 23 May 05 SHL Use datamin.h
[179]15 26 May 05 SHL Comments
[189]16 06 Jun 05 SHL indent -i2
[201]17 06 Jun 05 SHL Rework FindSwapperDat for VAC3.65 compat
[339]18 13 Jul 06 SHL Use Runtime_Error
19 13 Jul 06 SHL Sync with current style
[404]20 29 Jul 06 SHL Use xfgets
[526]21 22 Oct 06 GKY Add NDFS32 support
[552]22 18 Feb 07 GKY Add ISOFS, RAMFS support
[593]23 30 Mar 07 GKY Defined golbals for removing GetPString for window class names
[627]24 21 Apr 07 GKY Find FM2Utils by path or utils directory eleminate fAddUtils global
[690]25 15 Jun 07 SHL Make OpenWatcom compatible
[705]26 23 Jun 07 GKY Fix WORPLACE_PROCESS enviroment check logic
[718]27 28 Jun 07 SHL Rework WORKPLACE_PROCESS check to match reality
[756]28 03 Aug 07 GKY Enlarged and made setable everywhere Findbuf (speed file loading)
[775]29 06 Aug 07 GKY Reduce DosSleep times (ticket 148)
[783]30 13 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat
[784]31 18 Aug 07 JBS Added code to read Details* keys from the INI file (Ticket 118)
[789]32 19 Aug 07 SHL Ensure FilesToGet in valid range
[796]33 21 Aug 07 GKY Make Subject column in dircnr sizable and movable from the rigth to the left pane
[32]34
35***********************************************************************/
36
[2]37#define DEFINE_GLOBALS 1
38
39#define INCL_DOS
40#define INCL_WIN
41#define INCL_MMIOOS2
42#define INCL_GPI
43
44#include <os2.h>
45#include <os2me.h>
46#include <stdlib.h>
47#include <stdio.h>
48#include <string.h>
49#include <ctype.h>
50#include <share.h>
51#include <time.h>
52#include <process.h>
[133]53
[2]54#include "fm3dll.h"
55#include "fm3dlg.h"
[133]56#include "datamin.h"
[2]57#include "tools.h"
58#include "fm3str.h"
59#include "version.h"
60
[783]61#ifdef __IBMC__
[690]62#pragma alloc_text(INIT,LibMain,InitFM3DLL,DeInitFM3DLL)
[783]63#pragma alloc_text(INIT1,StartFM3,FindSwapperDat)
[690]64#endif
65
[189]66extern int _CRT_init(void);
[2]67extern void _CRT_term(void);
68
[339]69static PSZ pszSrcFile = __FILE__;
[2]70
[189]71VOID FindSwapperDat(VOID)
72{
[201]73 CHAR filename[] = "C:\\CONFIG.SYS";
74 CHAR input[8192];
75 CHAR *p;
76 CHAR *pp;
[189]77 FILE *fp;
[2]78 FILEFINDBUF3 ffb;
[201]79 ULONG nm;
80 ULONG size = sizeof(SwapperDat);
[189]81 HDIR hdir = HDIR_CREATE;
[201]82 APIRET rc = 1;
[2]83
84 *SwapperDat = 0;
[201]85 // Check already known
[2]86 PrfQueryProfileData(fmprof,
[551]87 FM3Str, "SwapperDat", (PVOID) SwapperDat, &size);
88 if (*SwapperDat) {
[201]89 nm = 1;
[2]90 rc = DosFindFirst(SwapperDat,
[189]91 &hdir,
92 FILE_NORMAL | FILE_ARCHIVED |
93 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
[551]94 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
95 if (!rc) {
[2]96 DosFindClose(hdir);
[189]97 fp = fopen(SwapperDat, "r");
[551]98 if (fp) {
[189]99 fclose(fp);
100 *SwapperDat = 0;
[551]101 rc = 1; // Force config.sys scan
[2]102 }
103 }
104 else
105 *SwapperDat = 0;
106 }
[201]107 // If not defined in INI or INI wrong, scan config.sys for SWAPPATH statement
[551]108 if (rc) {
[189]109 if (DosQuerySysInfo(QSV_BOOT_DRIVE,
110 QSV_BOOT_DRIVE,
[551]111 (PVOID) & nm, (ULONG) sizeof(ULONG))) {
112 nm = 3; // Assume drive C:
[201]113 }
[551]114 *filename = (CHAR) nm + '@';
[404]115 fp = xfsopen(filename, "r", SH_DENYNO, pszSrcFile, __LINE__);
[551]116 if (fp) {
[404]117 while (!feof(fp)) {
[551]118 if (!xfgets(input, sizeof(input), fp, pszSrcFile, __LINE__))
[189]119 break;
120 lstrip(input);
[551]121 if (!strnicmp(input, "SWAPPATH", 8)) {
[189]122 p = input + 8;
123 while (*p == ' ')
124 p++;
[551]125 if (*p == '=') {
[189]126 p++;
127 stripcr(p);
128 rstrip(p);
129 while (*p == ' ')
130 p++;
[551]131 if (*p == '\"') {
[189]132 p++;
133 pp = p;
134 while (*pp && *pp != '\"')
[689]135 *pp += 1;
[189]136 if (*pp)
137 *pp = 0;
138 }
[551]139 else {
[189]140 pp = strchr(p, ' ');
141 if (pp)
142 *pp = 0;
143 }
[551]144 if (*p) {
[189]145 strncpy(SwapperDat, p, CCHMAXPATH);
146 SwapperDat[CCHMAXPATH - 1] = 0;
147 if (SwapperDat[strlen(SwapperDat) - 1] != '\\')
148 strcat(SwapperDat, "\\");
149 strcat(SwapperDat, "SWAPPER.DAT");
150 hdir = HDIR_CREATE;
[201]151 nm = 1;
[189]152 if (!DosFindFirst(SwapperDat,
153 &hdir,
154 FILE_NORMAL | FILE_ARCHIVED |
155 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
[551]156 &ffb, sizeof(ffb), &nm, FIL_STANDARD)) {
[189]157 DosFindClose(hdir);
158 PrfWriteProfileString(fmprof,
[551]159 FM3Str, "SwapperDat", SwapperDat);
[189]160 }
161 else
162 *SwapperDat = 0;
163 break;
164 }
165 }
[551]166 } // if SWAPPATH
167 } // while
[2]168 fclose(fp);
169 }
170 }
171}
172
[690]173#ifdef __WATCOMC__
174
175unsigned APIENTRY LibMain(unsigned hModule,
[783]176 unsigned ulFlag)
[690]177{
178 CHAR *env;
179 CHAR stringfile[CCHMAXPATH];
180 FILESTATUS3 fsa;
181 APIRET rc;
182
183 switch (ulFlag) {
184 case 0:
185 // 14 Jun 07 SHL Already done for us
186 // if (_CRT_init() == -1)
187 // return 0UL;
188 FM3DllHandle = hModule;
189 strcpy(stringfile, "FM3RES.STR");
190 env = getenv("FM3INI");
191 if (env) {
192 DosError(FERR_DISABLEHARDERR);
193 rc = DosQueryPathInfo(env, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa));
194 if (!rc) {
195 if (fsa.attrFile & FILE_DIRECTORY) {
196 strcpy(stringfile, env);
197 if (stringfile[strlen(stringfile) - 1] != '\\')
198 strcat(stringfile, "\\");
199 strcat(stringfile, "FM3RES.STR");
200 DosError(FERR_DISABLEHARDERR);
201 if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa)))
202 strcpy(stringfile, "FM3RES.STR");
203 }
204 }
205 }
206 LoadStrings(stringfile);
207
208 DosError(FERR_DISABLEHARDERR);
209 /* strings here to prevent multiple occurences in DLL */
210 FM2Str = "FM/2";
211 FM3Str = "FM/3";
212 NullStr = "";
213 Default = "DEFAULT";
214 Settings = "SETTINGS";
215 WPProgram = "WPProgram";
216 FM3Folder = "<FM3_Folder>";
217 FM3Tools = "<FM3_Tools>";
218 DRM_OS2FILE = "DRM_OS2FILE";
219 DRM_FM2ARCMEMBER = "DRM_FM2ARCMEMBER";
220 DRF_FM2ARCHIVE = "DRF_FM2ARCHIVE";
221 DRMDRFLIST = "<DRM_OS2FILE,DRF_UNKNOWN>,"
222 "<DRM_DISCARD,DRF_UNKNOWN>," "<DRM_PRINT,DRF_UNKNOWN>";
223 DRMDRFOS2FILE = "<DRM_OS2FILE,DRF_UNKNOWN>";
224 DRMDRFFM2ARC = "<DRM_FM2ARCMEMBER,DRF_FM2ARCHIVE>";
225 DRM_FM2INIRECORD = "DRM_FM2INIRECORD";
226 DRF_FM2INI = "DRF_FM2INI";
227 SUBJECT = ".SUBJECT";
228 LONGNAME = ".LONGNAME";
229 HPFS = "HPFS";
230 JFS = "JFS";
231 CDFS = "CDFS";
232 ISOFS = "ISOFS";
233 FAT32 = "FAT32";
234 HPFS386 = "HPFS386";
235 CBSIFS = "CBSIFS";
236 NDFS32 = "NDFS32";
237 RAMFS = "RAMFS";
238 NTFS = "NTFS";
239 WC_OBJECTWINDOW = "WC_OBJECTWINDOW";
240 WC_BUBBLE = "WC_BUBBLE";
241 WC_TOOLBUTTONS = "WC_TOOLBUTTONS";
242 WC_DRIVEBUTTONS = "WC_DRIVEBUTTONS";
243 WC_DIRCONTAINER = "WC_DIRCONTAINER";
244 WC_DIRSTATUS = "WC_DIRSTATUS";
245 WC_TREECONTAINER = "WC_TREECONTAINER";
246 WC_TREEOPENBUTTON = "WC_TREEOPENBUTTON";
247 WC_TREESTATUS = "WC_TREESTATUS";
248 WC_MAINWND = "WC_MAINWND";
249 WC_MAINWND2 = "WC_MAINWND2";
250 WC_AUTOVIEW = "WC_AUTOVIEW";
251 WC_LED = "WC_LED";
252 WC_COLLECTOR = "WC_COLLECTOR";
253 WC_COLSTATUS = "WC_COLSTATUS";
254 WC_STATUS = "WC_STATUS";
255 WC_TOOLBACK = "WC_TOOLBACK";
256 WC_DRIVEBACK = "WC_DRIVEBACK";
257 WC_ARCCONTAINER = "WC_ARCCONTAINER";
258 WC_ARCSTATUS = "WC_ARCSTATUS";
259 WC_MLEEDITOR = "WC_MLEEDITOR";
260 WC_INIEDITOR = "WC_INIEDITOR";
261 WC_SEEALL = "WC_SEEALL";
262 WC_NEWVIEW = "WC_NEWVIEW";
263 WC_SEESTATUS = "WC_SEESTATUS";
264 WC_VIEWSTATUS = "WC_VIEWSTATUS";
265 WC_ERRORWND = "WC_ERRORWND";
266 WC_MINITIME = "WC_MINITIME";
267 WC_DATABAR = "WC_DATABAR";
268
269 /* end of strings */
270 memset(&RGBBLACK, 0, sizeof(RGB2));
271 RGBGREY.bRed = RGBGREY.bGreen = RGBGREY.bBlue = (BYTE)204;
272 RGBGREY.fcOptions = 0;
273 FM3UL = *(ULONG *) FM3Str;
274 DEBUG_STRING = "Debug -- please report to author";
275 break;
276 case 1:
277 StopPrinting = 1;
278 if (fmprof)
279 PrfCloseProfile(fmprof);
280 DosError(FERR_ENABLEHARDERR);
281 // 14 Jun 07 SHL Already done for us
282 // _CRT_term();
283 break;
284 default:
285 return 0UL;
286 }
287 return 1UL;
288}
289
290#else // __IBMC__
291
[189]292unsigned long _System _DLL_InitTerm(unsigned long hModule,
293 unsigned long ulFlag)
294{
[201]295 CHAR *env;
296 CHAR stringfile[CCHMAXPATH];
297 FILESTATUS3 fsa;
298 APIRET rc;
[2]299
[551]300 switch (ulFlag) {
[189]301 case 0:
302 if (_CRT_init() == -1)
303 return 0UL;
304 FM3DllHandle = hModule;
[201]305 strcpy(stringfile, "FM3RES.STR");
306 env = getenv("FM3INI");
[551]307 if (env) {
[201]308 DosError(FERR_DISABLEHARDERR);
[551]309 rc = DosQueryPathInfo(env, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa));
310 if (!rc) {
311 if (fsa.attrFile & FILE_DIRECTORY) {
[201]312 strcpy(stringfile, env);
313 if (stringfile[strlen(stringfile) - 1] != '\\')
314 strcat(stringfile, "\\");
315 strcat(stringfile, "FM3RES.STR");
316 DosError(FERR_DISABLEHARDERR);
[551]317 if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa)))
[201]318 strcpy(stringfile, "FM3RES.STR");
[189]319 }
[2]320 }
[189]321 }
[201]322 LoadStrings(stringfile);
323
[189]324 DosError(FERR_DISABLEHARDERR);
325 /* strings here to prevent multiple occurences in DLL */
326 FM2Str = "FM/2";
327 FM3Str = "FM/3";
328 NullStr = "";
329 Default = "DEFAULT";
330 Settings = "SETTINGS";
331 WPProgram = "WPProgram";
332 FM3Folder = "<FM3_Folder>";
333 FM3Tools = "<FM3_Tools>";
334 DRM_OS2FILE = "DRM_OS2FILE";
335 DRM_FM2ARCMEMBER = "DRM_FM2ARCMEMBER";
336 DRF_FM2ARCHIVE = "DRF_FM2ARCHIVE";
337 DRMDRFLIST = "<DRM_OS2FILE,DRF_UNKNOWN>,"
[551]338 "<DRM_DISCARD,DRF_UNKNOWN>," "<DRM_PRINT,DRF_UNKNOWN>";
[189]339 DRMDRFOS2FILE = "<DRM_OS2FILE,DRF_UNKNOWN>";
340 DRMDRFFM2ARC = "<DRM_FM2ARCMEMBER,DRF_FM2ARCHIVE>";
341 DRM_FM2INIRECORD = "DRM_FM2INIRECORD";
342 DRF_FM2INI = "DRF_FM2INI";
343 SUBJECT = ".SUBJECT";
344 LONGNAME = ".LONGNAME";
345 HPFS = "HPFS";
346 JFS = "JFS";
347 CDFS = "CDFS";
[552]348 ISOFS = "ISOFS";
[189]349 FAT32 = "FAT32";
350 HPFS386 = "HPFS386";
351 CBSIFS = "CBSIFS";
[526]352 NDFS32 = "NDFS32";
[552]353 RAMFS = "RAMFS";
[555]354 NTFS = "NTFS";
[593]355 WC_OBJECTWINDOW = "WC_OBJECTWINDOW";
356 WC_BUBBLE = "WC_BUBBLE";
357 WC_TOOLBUTTONS = "WC_TOOLBUTTONS";
358 WC_DRIVEBUTTONS = "WC_DRIVEBUTTONS";
359 WC_DIRCONTAINER = "WC_DIRCONTAINER";
360 WC_DIRSTATUS = "WC_DIRSTATUS";
361 WC_TREECONTAINER = "WC_TREECONTAINER";
362 WC_TREEOPENBUTTON = "WC_TREEOPENBUTTON";
363 WC_TREESTATUS = "WC_TREESTATUS";
364 WC_MAINWND = "WC_MAINWND";
365 WC_MAINWND2 = "WC_MAINWND2";
366 WC_AUTOVIEW = "WC_AUTOVIEW";
367 WC_LED = "WC_LED";
368 WC_COLLECTOR = "WC_COLLECTOR";
369 WC_COLSTATUS = "WC_COLSTATUS";
370 WC_STATUS = "WC_STATUS";
371 WC_TOOLBACK = "WC_TOOLBACK";
372 WC_DRIVEBACK = "WC_DRIVEBACK";
373 WC_ARCCONTAINER = "WC_ARCCONTAINER";
374 WC_ARCSTATUS = "WC_ARCSTATUS";
375 WC_MLEEDITOR = "WC_MLEEDITOR";
376 WC_INIEDITOR = "WC_INIEDITOR";
377 WC_SEEALL = "WC_SEEALL";
378 WC_NEWVIEW = "WC_NEWVIEW";
379 WC_SEESTATUS = "WC_SEESTATUS";
380 WC_VIEWSTATUS = "WC_VIEWSTATUS";
381 WC_ERRORWND = "WC_ERRORWND";
382 WC_MINITIME = "WC_MINITIME";
383 WC_DATABAR = "WC_DATABAR";
384
[189]385 /* end of strings */
386 memset(&RGBBLACK, 0, sizeof(RGB2));
[689]387 RGBGREY.bRed = RGBGREY.bGreen = RGBGREY.bBlue = (BYTE)204;
[189]388 RGBGREY.fcOptions = 0;
[551]389 FM3UL = *(ULONG *) FM3Str;
[189]390 DEBUG_STRING = "Debug -- please report to author";
391 break;
392 case 1:
393 StopPrinting = 1;
394 if (fmprof)
395 PrfCloseProfile(fmprof);
396 DosError(FERR_ENABLEHARDERR);
397 _CRT_term();
398 break;
399 default:
400 return 0UL;
[2]401 }
402 return 1UL;
403}
404
[690]405#endif // __IBMC__
406
[189]407VOID APIENTRY DeInitFM3DLL(ULONG why)
408{
[2]409 /* cleanup */
[189]410 static CHAR s[CCHMAXPATH];
411 CHAR *enddir;
412 HDIR search_handle;
413 ULONG num_matches;
[2]414 static FILEFINDBUF3 f;
415
416 StopTimer();
417 StopPrinting = 1;
418
[189]419 if (LogFileHandle)
[2]420 fclose(LogFileHandle);
421
[551]422 if (fmprof) {
[2]423 PrfCloseProfile(fmprof);
[189]424 fmprof = (HINI) 0;
[551]425 if (fIniExisted) {
[2]426 DosError(FERR_DISABLEHARDERR);
[551]427 DosCopy("FM3.INI", "FM3INI.BAK", DCPY_EXISTING);
[2]428 }
429 }
430
[189]431 if (fToolsChanged)
[2]432 save_tools(NULL);
433
[689]434# ifdef __IBMC__
[2]435 _fcloseall();
[689]436# else // __WATCOMC__
437 fcloseall();
438# endif
[2]439
440 save_dir(s);
[189]441 if (s[strlen(s) - 1] != '\\')
442 strcat(s, "\\");
[2]443 enddir = &s[strlen(s)];
[551]444 if (*ArcTempRoot) {
[189]445 strcat(s, ArcTempRoot);
446 strcat(s, "*");
[2]447 search_handle = HDIR_CREATE;
448 num_matches = 1L;
[189]449 if (!DosFindFirst(s,
450 &search_handle,
451 FILE_NORMAL | FILE_DIRECTORY |
452 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN |
453 FILE_ARCHIVED,
[551]454 &f, sizeof(FILEFINDBUF3), &num_matches, FIL_STANDARD)) {
455 do {
[189]456 strcpy(enddir, f.achName);
[551]457 if (f.attrFile & FILE_DIRECTORY) {
[189]458 wipeallf("%s\\*", s);
459 DosDeleteDir(s);
460 }
461 else
462 unlinkf("%s", s);
463 }
464 while (!DosFindNext(search_handle,
[551]465 &f, sizeof(FILEFINDBUF3), &num_matches));
[2]466 DosFindClose(search_handle);
467 }
468 }
469
470 save_dir(s);
[189]471 if (s[strlen(s) - 1] != '\\')
472 strcat(s, "\\");
[2]473 enddir = &s[strlen(s)];
[189]474 strcat(s, LISTTEMPROOT);
475 strcat(s, "???");
[2]476 search_handle = HDIR_CREATE;
477 num_matches = 1L;
[189]478 if (!DosFindFirst(s,
479 &search_handle,
480 FILE_NORMAL | FILE_DIRECTORY |
481 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN |
482 FILE_ARCHIVED,
[551]483 &f, sizeof(FILEFINDBUF3), &num_matches, FIL_STANDARD)) {
484 do {
485 if (!(f.attrFile & FILE_DIRECTORY)) {
[189]486 strcpy(enddir, f.achName);
487 unlinkf("%s", s);
[2]488 }
[189]489 }
490 while (!DosFindNext(search_handle,
[551]491 &f, sizeof(FILEFINDBUF3), &num_matches));
[2]492 DosFindClose(search_handle);
493 }
494
495 DosForceDelete("$FM2PLAY.$$$");
496
497 EndNote();
498
[189]499 if (FM3ModHandle)
[2]500 DosFreeModule(FM3ModHandle);
501
[551]502 DosExitList(EXLST_REMOVE, DeInitFM3DLL);
[2]503}
504
[189]505BOOL InitFM3DLL(HAB hab, int argc, char **argv)
506{
[2]507 /*
508 * this function should be called by any application using this DLL right
509 * after setting up a message queue
510 */
511
512 CLASSINFO clinfo;
[201]513 APIRET rc;
514 APIRET rcl = 1;
515 APIRET rcq = 1;
[551]516 PFN pfnResVersion = (PFN) NULL;
[201]517 ULONG RVMajor = 0;
518 ULONG RVMinor = 0;
519 ULONG ret = 0;
520 FILESTATUS3 fsa;
521 CHAR *env;
522 CHAR dllfile[CCHMAXPATH];
523 ULONG size;
[2]524
[551]525 if (!StringsLoaded()) {
[2]526 saymsg(MB_ENTER,
[189]527 HWND_DESKTOP,
528 "Error",
529 "FM3RES.STR isn't in right format, at least "
530 "for this version of FM/2.");
[2]531 return FALSE;
532 }
533
[201]534 strcpy(dllfile, "FM3RES");
535 env = getenv("FM3INI");
[551]536 if (env) {
[201]537 FILESTATUS3 fsa;
538 APIRET rc;
[2]539
[201]540 DosError(FERR_DISABLEHARDERR);
[551]541 rc = DosQueryPathInfo(env, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa));
542 if (!rc) {
543 if (fsa.attrFile & FILE_DIRECTORY) {
[201]544 strcpy(dllfile, env);
545 if (dllfile[strlen(dllfile) - 1] != '\\')
546 strcat(dllfile, "\\");
547 strcat(dllfile, "FM3RES");
548 DosError(FERR_DISABLEHARDERR);
[551]549 if (DosQueryPathInfo(dllfile, FIL_STANDARD, &fsa, sizeof(fsa)))
[201]550 strcpy(dllfile, "FM3RES");
[2]551 }
552 }
[201]553 }
[551]554 rcl = DosLoadModule(NULL, 0, dllfile, &FM3ModHandle);
555 if (rcl) {
[339]556 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
557 HWND_DESKTOP,
[551]558 GetPString(IDS_ERRORTEXT), GetPString(IDS_FM3RESERROR1TEXT));
[339]559 return FALSE;
560 }
561 else {
562 rc = DosExitList(EXLST_ADD, DeInitFM3DLL);
[551]563 if (rc) {
[339]564 Dos_Error(MB_ENTER,
[551]565 rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosExitList failed");
[339]566 }
[551]567 rcq = DosQueryProcAddr(FM3ModHandle, 1, "ResVersion", &pfnResVersion);
[201]568 if (!rcq)
569 ret = pfnResVersion(&RVMajor, &RVMinor);
570 }
[339]571
[551]572 if (RVMajor < VERMAJOR || (RVMajor == VERMAJOR && RVMinor < VERMINOR)) {
[201]573 saymsg(MB_ENTER,
574 HWND_DESKTOP,
575 GetPString(IDS_ERRORTEXT),
576 GetPString(IDS_FM3RESERROR2TEXT),
577 !rcq ?
[551]578 GetPString(IDS_FM3RESERROR3TEXT) :
579 !rcl ?
580 GetPString(IDS_FM3RESERROR4TEXT) :
581 GetPString(IDS_FM3RESERROR5TEXT), RVMajor, RVMinor, rcl, rcq, ret);
[201]582 return FALSE;
[2]583 }
584
[189]585 ArgDriveFlags(argc, argv);
[2]586 FillInDriveFlags(NULL);
587
[189]588 if (!*profile)
589 strcpy(profile, "FM3.INI");
[2]590 mypid = getpid();
591 /* give default appname if none set by caller */
[189]592 if (!*appname)
593 strcpy(appname, FM3Str);
[2]594 /* save appname; may be reset below */
[189]595 strcpy(realappname, appname);
596 if (!strcmp(appname, FM3Str))
[2]597 DosSetMaxFH(100L);
[189]598 else if (!strcmp(appname, "VDir") ||
599 !strcmp(appname, "VTree") ||
600 !strcmp(appname, "VCollect") ||
[551]601 !strcmp(appname, "SEEALL") || !strcmp(appname, "FM/4"))
[2]602 DosSetMaxFH(60L);
603 else
604 DosSetMaxFH(40L);
605
[189]606 if (DosQuerySysInfo(QSV_VERSION_MAJOR,
607 QSV_VERSION_MINOR,
[551]608 (PVOID) OS2ver, (ULONG) sizeof(OS2ver))) {
[2]609 OS2ver[0] = 2;
610 OS2ver[1] = 1;
611 }
612
613 /* set up default root names for temp archive goodies */
[189]614 if (!fAmAV2)
615 strcpy(ArcTempRoot, "$FM$ARC$");
[2]616 else
[189]617 strcpy(ArcTempRoot, "$AV$ARC$");
[2]618
619 /* initialize random number generator */
620 srand(time(NULL) + clock());
621
622 priority_bumped();
623
624 /* _heapmin() is done in a separate thread -- start it */
[551]625 if (_beginthread(HeapThread, NULL, 32768, NULL) == -1) {
626 Runtime_Error(pszSrcFile, __LINE__,
627 GetPString(IDS_COULDNTSTARTTHREADTEXT));
[339]628 return FALSE;
629 }
[189]630 /* timer messages are sent from a separate thread -- start it */
[339]631 if (!StartTimer())
[2]632 return FALSE;
633
[718]634 /* Are we the workplace shell? */
[705]635 env = getenv("WORKPLACE_PROCESS");
[718]636 fWorkPlace = env != NULL &&
637 (stricmp(env, "YES") == 0 || atoi(env) == 1);
638
[189]639 if ((!strchr(profile, '\\') && !strchr(profile, ':')) ||
[551]640 !(fmprof = PrfOpenProfile((HAB) 0, profile))) {
[2]641 /* figure out where to put INI file... */
[189]642 CHAR *env, inipath[CCHMAXPATH];
[2]643
644 DosError(FERR_DISABLEHARDERR);
645 save_dir2(HomePath);
646 DosError(FERR_DISABLEHARDERR);
[189]647 memset(driveserial, -1, sizeof(driveserial));
[2]648 *inipath = 0;
649 env = getenv("FM3INI");
[551]650 if (env) {
[189]651 strcpy(inipath, env);
[2]652 DosError(FERR_DISABLEHARDERR);
[551]653 rc = DosQueryPathInfo(inipath, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa));
654 if (!rc) {
655 if (fsa.attrFile & FILE_DIRECTORY) {
[189]656 if (inipath[strlen(inipath) - 1] != '\\')
657 strcat(inipath, "\\");
658 strcat(inipath, profile);
659 }
[2]660 }
661 }
[551]662 if (!env) {
[2]663 env = searchpath(profile);
[189]664 if (!env)
665 env = profile;
666 strcpy(inipath, env);
[2]667 }
[201]668
[2]669 /* in some odd cases the INI file can get set to readonly status */
670 /* here we test it and reset the readonly bit if necessary */
[201]671 if (!*inipath)
672 strcpy(inipath, profile);
673 DosError(FERR_DISABLEHARDERR);
[551]674 if (!DosQueryPathInfo(inipath, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa))) {
[201]675 fIniExisted = TRUE;
[551]676 if (fsa.attrFile & (FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM)) {
[201]677 fsa.attrFile &= (~(FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM));
678 if (DosSetPathInfo(inipath, FIL_STANDARD, (PVOID) & fsa,
679 (ULONG) sizeof(fsa), 0L))
680 saymsg(MB_ENTER,
681 HWND_DESKTOP,
682 GetPString(IDS_ERRORTEXT),
[551]683 GetPString(IDS_INIREADONLYTEXT), inipath);
[2]684 }
685 }
[201]686
[189]687 fmprof = PrfOpenProfile((HAB) 0, inipath);
[551]688 if (!fmprof) {
[189]689 strcpy(inipath, "FM3.INI");
690 fmprof = PrfOpenProfile((HAB) 0, inipath);
[2]691 }
[201]692
[551]693 if (!fmprof) {
694 Win_Error(NULLHANDLE, NULLHANDLE, pszSrcFile, __LINE__,
695 "PrfOpenProfile failed");
[2]696 return FALSE;
697 }
698 }
699
700 FindSwapperDat();
701
[201]702 size = sizeof(BOOL);
703 PrfQueryProfileData(fmprof,
704 FM3Str,
[551]705 "SeparateParms", (PVOID) & fSeparateParms, &size);
[201]706 if (!fSeparateParms)
707 strcpy(appname, FM3Str);
[2]708
709 /* start help */
[189]710 memset(&hini, 0, sizeof(HELPINIT));
[2]711 hini.cb = sizeof(HELPINIT);
712 hini.ulReturnCode = 0L;
713 hini.pszTutorialName = NULL;
[189]714 hini.phtHelpTable = (PHELPTABLE) MAKELONG(ID_HELPTABLE, 0xffff);
715 hini.hmodAccelActionBarModule = (HMODULE) 0;
[2]716 hini.idAccelTable = 0;
717 hini.idActionBar = 0;
718 hini.pszHelpWindowTitle = GetPString(IDS_FM2HELPTITLETEXT);
719 hini.fShowPanelId = CMIC_HIDE_PANEL_ID;
720 hini.pszHelpLibraryName = "FM3.HLP";
[189]721 hwndHelp = WinCreateHelpInstance(hab, &hini);
[551]722 if (!hwndHelp) {
[201]723 static CHAR helppath[CCHMAXPATH]; // fixme to be local?
[2]724
725 env = getenv("FM3INI");
[551]726 if (env) {
[2]727 FILESTATUS3 fsa;
[189]728 APIRET rc;
[2]729
[189]730 strcpy(helppath, env);
[2]731 DosError(FERR_DISABLEHARDERR);
[551]732 rc =
733 DosQueryPathInfo(helppath, FIL_STANDARD, &fsa, (ULONG) sizeof(fsa));
734 if (!rc) {
735 if (fsa.attrFile & FILE_DIRECTORY) {
[189]736 if (helppath[strlen(helppath) - 1] != '\\')
737 strcat(helppath, "\\");
738 strcat(helppath, "FM3.HLP");
739 hini.pszHelpLibraryName = helppath;
740 hwndHelp = WinCreateHelpInstance(hab, &hini);
741 }
[2]742 }
743 }
744 }
[551]745 if (!hwndHelp) {
[2]746 saymsg(MB_ENTER | MB_ICONEXCLAMATION,
[189]747 HWND_DESKTOP,
748 GetPString(IDS_FM2TROUBLETEXT),
749 GetPString(IDS_CANTLOADHELPTEXT),
750 GetPString(IDS_NOHELPACCEPTTEXT));
[2]751 }
752
753 /* a couple of default window procs so we don't have to look them up later */
[189]754 if (WinQueryClassInfo(hab, WC_CONTAINER, &clinfo))
[2]755 PFNWPCnr = clinfo.pfnWindowProc;
[179]756 // saymsg(MB_ENTER,HWND_DESKTOP,"Container flags:","%08lx",clinfo.flClassStyle);
[189]757 if (WinQueryClassInfo(hab, WC_FRAME, &clinfo))
[2]758 PFNWPFrame = clinfo.pfnWindowProc;
[179]759 // saymsg(MB_ENTER,HWND_DESKTOP,"Frame flags:","%08lx",clinfo.flClassStyle);
[189]760 if (WinQueryClassInfo(hab, WC_BUTTON, &clinfo))
[2]761 PFNWPButton = clinfo.pfnWindowProc;
[179]762 // saymsg(MB_ENTER,HWND_DESKTOP,"Button flags:","%08lx",clinfo.flClassStyle);
[189]763 if (WinQueryClassInfo(hab, WC_STATIC, &clinfo))
[2]764 PFNWPStatic = clinfo.pfnWindowProc;
[179]765 // saymsg(MB_ENTER,HWND_DESKTOP,"Static flags:","%08lx",clinfo.flClassStyle);
[189]766 if (WinQueryClassInfo(hab, WC_MLE, &clinfo))
[2]767 PFNWPMLE = clinfo.pfnWindowProc;
[179]768 // saymsg(MB_ENTER,HWND_DESKTOP,"MLE flags:","%08lx",clinfo.flClassStyle);
[551]769 if (!PFNWPCnr || !PFNWPFrame || !PFNWPButton || !PFNWPStatic || !PFNWPMLE) {
[339]770 Runtime_Error(pszSrcFile, __LINE__, "WinQueryClassInfo");
[2]771 return FALSE;
772 }
773
774 /* register window classes we use */
775 WinRegisterClass(hab,
[593]776 WC_MAINWND,
[189]777 MainWndProc,
[551]778 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 8);
[2]779 WinRegisterClass(hab,
[593]780 WC_MAINWND2,
[189]781 MainWndProc2,
[551]782 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 4);
[2]783 WinRegisterClass(hab,
[593]784 WC_TREECONTAINER,
[189]785 TreeClientWndProc,
[551]786 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]787 WinRegisterClass(hab,
[593]788 WC_DIRCONTAINER,
[189]789 DirClientWndProc,
[551]790 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]791 WinRegisterClass(hab,
[593]792 WC_COLLECTOR,
[189]793 CollectorClientWndProc,
[551]794 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]795 WinRegisterClass(hab,
[593]796 WC_ARCCONTAINER,
[189]797 ArcClientWndProc,
[551]798 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]799 WinRegisterClass(hab,
[593]800 WC_MLEEDITOR,
[189]801 MLEEditorProc,
[551]802 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]803 WinRegisterClass(hab,
[593]804 WC_INIEDITOR,
[189]805 IniProc,
[551]806 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]807 WinRegisterClass(hab,
[593]808 WC_TOOLBACK,
[551]809 ToolBackProc, CS_SIZEREDRAW, sizeof(PVOID));
[2]810 WinRegisterClass(hab,
[593]811 WC_DRIVEBACK,
[189]812 DriveBackProc,
813 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
814 sizeof(PVOID));
[2]815 WinRegisterClass(hab,
[593]816 WC_SEEALL,
[189]817 SeeAllWndProc,
[551]818 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
[2]819 WinRegisterClass(hab,
[593]820 WC_NEWVIEW,
[189]821 ViewWndProc,
[551]822 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
[2]823 WinRegisterClass(hab,
[593]824 WC_TOOLBUTTONS,
[189]825 ChildButtonProc,
826 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
827 sizeof(PVOID));
[2]828 WinRegisterClass(hab,
[593]829 WC_DRIVEBUTTONS,
[189]830 DriveProc,
831 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
832 sizeof(PVOID));
[2]833 WinRegisterClass(hab,
[593]834 WC_BUBBLE,
[189]835 BubbleProc,
836 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
837 sizeof(ULONG) * 2);
[2]838 WinRegisterClass(hab,
[593]839 WC_STATUS,
[189]840 StatusProc,
841 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
842 sizeof(ULONG));
[2]843 WinRegisterClass(hab,
[593]844 WC_DIRSTATUS,
[189]845 DirTextProc,
846 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
847 sizeof(ULONG));
[2]848 WinRegisterClass(hab,
[593]849 WC_TREESTATUS,
[189]850 TreeStatProc,
851 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
852 sizeof(ULONG));
[2]853 WinRegisterClass(hab,
[593]854 WC_ARCSTATUS,
[189]855 ArcTextProc,
856 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
857 sizeof(ULONG));
[2]858 WinRegisterClass(hab,
[593]859 WC_COLSTATUS,
[189]860 CollectorTextProc,
861 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
862 sizeof(ULONG));
[2]863 WinRegisterClass(hab,
[593]864 WC_SEESTATUS,
[189]865 SeeStatusProc,
866 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
867 sizeof(ULONG));
[2]868 WinRegisterClass(hab,
[593]869 WC_VIEWSTATUS,
[189]870 ViewStatusProc,
871 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
872 sizeof(ULONG));
[2]873 WinRegisterClass(hab,
[593]874 WC_ERRORWND,
[189]875 NotifyWndProc,
876 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
877 sizeof(PVOID));
[2]878 WinRegisterClass(hab,
[593]879 WC_MINITIME,
[189]880 MiniTimeProc,
881 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
882 sizeof(PVOID) * 2);
[2]883 WinRegisterClass(hab,
[593]884 WC_DATABAR,
[551]885 DataProc, CS_SIZEREDRAW, sizeof(PVOID));
[2]886 WinRegisterClass(hab,
[593]887 WC_TREEOPENBUTTON,
[189]888 OpenButtonProc,
889 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
890 sizeof(PVOID));
[2]891 WinRegisterClass(hab,
[593]892 WC_AUTOVIEW,
[189]893 AutoViewProc,
894 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
895 sizeof(PVOID));
[2]896 WinRegisterClass(hab,
[593]897 WC_LED,
[189]898 LEDProc,
899 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
900 sizeof(PVOID));
[2]901
902 /*
[201]903 * set some defaults (note: everything else automatically initialized
[2]904 * to 0)
905 */
906 detailssize = detailsea = detailslwdate = detailslwtime = detailsattr =
[189]907 detailsicon = fAutoTile = fConfirmDelete = fLoadSubject = fUnHilite =
908 fLoadLongnames = fToolbar = fSaveState = fGuessType = fToolbarHelp =
909 fAutoAddDirs = fUseNewViewer = fDataToFore = fDataShowDrives =
910 fSplitStatus = fDragndropDlg = fQuickArcFind = fKeepCmdLine =
911 fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree =
912 fSwitchTreeExpand = fNoSearch = fCustomFileDlg = fOtherHelp =
913 fSaveMiniCmds = fUserComboBox = fFM2Deletes = fConfirmTarget =
914 fShowTarget = fDrivebarHelp = fCheckMM = TRUE;
[2]915 ulCnrType = CCS_EXTENDSEL;
[789]916 FilesToGet = FILESTOGET_MIN;
[752]917 AutoviewHeight = 48;
[189]918 strcpy(printer, "PRN");
[2]919 prnwidth = 80;
920 prnlength = 66;
921 prntmargin = 6;
922 prnbmargin = 6;
923 prnlmargin = 6;
924 prnrmargin = 3;
925 prnspacing = 1;
926 prntabspaces = 8;
927 CollectorsortFlags = sortFlags = SORT_DIRSFIRST;
928
[201]929 // load preferences from profile (INI) file
930 size = sizeof(BOOL);
931 PrfQueryProfileData(fmprof,
[551]932 appname, "ShowTarget", (PVOID) & fShowTarget, &size);
[201]933 size = sizeof(BOOL);
[551]934 PrfQueryProfileData(fmprof, appname, "CheckMM", (PVOID) & fCheckMM, &size);
[201]935 size = sizeof(BOOL);
936 PrfQueryProfileData(fmprof,
937 appname,
[551]938 "ChangeTarget", (PVOID) & fChangeTarget, &size);
[201]939 size = sizeof(BOOL);
940 PrfQueryProfileData(fmprof,
941 appname,
[551]942 "ConfirmTarget", (PVOID) & fConfirmTarget, &size);
[201]943 size = sizeof(BOOL);
944 PrfQueryProfileData(fmprof,
945 FM3Str,
[551]946 "CustomFileDlg", (PVOID) & fCustomFileDlg, &size);
[201]947 size = sizeof(BOOL);
948 PrfQueryProfileData(fmprof,
[551]949 FM3Str, "SaveMiniCmds", (PVOID) & fSaveMiniCmds, &size);
[201]950 size = sizeof(BOOL);
951 PrfQueryProfileData(fmprof,
[551]952 appname, "SaveBigCmds", (PVOID) & fSaveBigCmds, &size);
[201]953 size = sizeof(BOOL);
954 PrfQueryProfileData(fmprof,
[551]955 appname, "NoFoldMenu", (PVOID) & fNoFoldMenu, &size);
[201]956 size = sizeof(BOOL);
957 PrfQueryProfileData(fmprof,
[551]958 FM3Str, "ThreadNotes", (PVOID) & fThreadNotes, &size);
959 size = sizeof(BOOL);
960 PrfQueryProfileData(fmprof, FM3Str, "Prnpagenums", (PVOID) & prnpagenums,
[201]961 &size);
962 size = sizeof(BOOL);
963 PrfQueryProfileData(fmprof, FM3Str, "Prnalt", (PVOID) & prnalt, &size);
964 size = sizeof(BOOL);
[551]965 PrfQueryProfileData(fmprof, FM3Str, "Prnformat", (PVOID) & prnformat,
966 &size);
[201]967 size = sizeof(BOOL);
968 PrfQueryProfileData(fmprof, FM3Str, "Prnformfeedbefore",
969 (PVOID) & prnformfeedbefore, &size);
970 size = sizeof(BOOL);
971 PrfQueryProfileData(fmprof,
972 FM3Str,
[551]973 "Prnformfeedafter", (PVOID) & prnformfeedafter, &size);
[201]974 size = sizeof(ULONG);
975 PrfQueryProfileData(fmprof, FM3Str, "Prntabspaces",
976 (PVOID) & prntabspaces, &size);
977 size = sizeof(ULONG);
978 PrfQueryProfileData(fmprof, FM3Str, "Prnwidth", (PVOID) & prnwidth, &size);
979 size = sizeof(ULONG);
[551]980 PrfQueryProfileData(fmprof, FM3Str, "Prnlength", (PVOID) & prnlength,
981 &size);
[201]982 size = sizeof(ULONG);
[551]983 PrfQueryProfileData(fmprof, FM3Str, "Prntmargin", (PVOID) & prntmargin,
984 &size);
[201]985 size = sizeof(ULONG);
[551]986 PrfQueryProfileData(fmprof, FM3Str, "Prnbmargin", (PVOID) & prnbmargin,
987 &size);
[201]988 size = sizeof(ULONG);
[551]989 PrfQueryProfileData(fmprof, FM3Str, "Prnlmargin", (PVOID) & prnlmargin,
990 &size);
[201]991 size = sizeof(ULONG);
[551]992 PrfQueryProfileData(fmprof, FM3Str, "Prnrmargin", (PVOID) & prnrmargin,
993 &size);
[201]994 size = sizeof(ULONG);
[551]995 PrfQueryProfileData(fmprof, FM3Str, "Prnspacing", (PVOID) & prnspacing,
996 &size);
[201]997 size = sizeof(BOOL);
998 PrfQueryProfileData(fmprof, FM3Str, "NoDead", (PVOID) & fNoDead, &size);
999 size = sizeof(BOOL);
1000 PrfQueryProfileData(fmprof, FM3Str, "NoFinger", (PVOID) & fNoFinger, &size);
1001 size = sizeof(BOOL);
1002 PrfQueryProfileData(fmprof, appname, "SwitchTree", (PVOID) & fSwitchTree,
1003 &size);
1004 size = sizeof(BOOL);
1005 PrfQueryProfileData(fmprof, appname, "SwitchTreeExpand",
1006 (PVOID) & fSwitchTreeExpand, &size);
1007 size = sizeof(BOOL);
1008 PrfQueryProfileData(fmprof, appname, "SwitchTreeOnFocus",
1009 (PVOID) & fSwitchTreeOnFocus, &size);
1010 size = sizeof(BOOL);
1011 PrfQueryProfileData(fmprof, appname, "CollapseFirst",
1012 (PVOID) & fCollapseFirst, &size);
1013 size = sizeof(BOOL);
1014 PrfQueryProfileData(fmprof, appname, "FilesInTree",
1015 (PVOID) & fFilesInTree, &size);
1016 size = sizeof(BOOL);
1017 PrfQueryProfileData(fmprof, FM3Str, "TopDir", (PVOID) & fTopDir, &size);
1018 size = sizeof(BOOL);
[551]1019 PrfQueryProfileData(fmprof, FM3Str, "LookInDir", (PVOID) & fLookInDir,
1020 &size);
1021 PrfQueryProfileString(fmprof, appname, "DefArc", NULL, szDefArc,
1022 sizeof(szDefArc));
[201]1023 size = sizeof(ULONG);
1024 PrfQueryProfileData(fmprof, FM3Str, "AutoviewHeight",
1025 (PVOID) & AutoviewHeight, &size);
1026 size = sizeof(BOOL);
[551]1027 PrfQueryProfileData(fmprof, FM3Str, "KeepCmdLine", (PVOID) & fKeepCmdLine,
1028 &size);
1029 if (strcmp(realappname, "FM/4")) {
[2]1030 size = sizeof(BOOL);
1031 PrfQueryProfileData(fmprof,
[551]1032 FM3Str, "MoreButtons", (PVOID) & fMoreButtons, &size);
[2]1033 size = sizeof(BOOL);
1034 PrfQueryProfileData(fmprof,
[551]1035 FM3Str, "Drivebar", (PVOID) & fDrivebar, &size);
[201]1036 }
1037 else
1038 fDrivebar = fMoreButtons = TRUE;
1039 size = sizeof(BOOL);
1040 PrfQueryProfileData(fmprof,
[551]1041 appname, "NoSearch", (PVOID) & fNoSearch, &size);
[201]1042 size = sizeof(BOOL);
1043 PrfQueryProfileData(fmprof,
[551]1044 appname, "GuessType", (PVOID) & fGuessType, &size);
[201]1045 size = sizeof(BOOL);
1046 PrfQueryProfileData(fmprof,
[551]1047 appname, "ViewChild", (PVOID) & fViewChild, &size);
[201]1048 size = sizeof(BOOL);
[551]1049 PrfQueryProfileData(fmprof, appname, "ShowEnv", (PVOID) & fShowEnv, &size);
[201]1050 size = sizeof(BOOL);
1051 PrfQueryProfileData(fmprof,
[551]1052 appname, "LeaveTree", (PVOID) & fLeaveTree, &size);
[201]1053 size = sizeof(BOOL);
1054 PrfQueryProfileData(fmprof, FM3Str, "Comments", (PVOID) & fComments, &size);
1055 size = sizeof(ULONG);
[551]1056 PrfQueryProfileData(fmprof, appname, "WS_ANIMATE", (PVOID) & fwsAnimate,
1057 &size);
[201]1058 if (fwsAnimate)
1059 fwsAnimate = WS_ANIMATE;
1060 size = sizeof(ULONG);
1061 size = sizeof(BOOL);
1062 PrfQueryProfileData(fmprof, appname, "SelectedAlways",
1063 (PVOID) & fSelectedAlways, &size);
1064 size = sizeof(BOOL);
[551]1065 PrfQueryProfileData(fmprof, FM3Str, "ToolbarHelp", (PVOID) & fToolbarHelp,
1066 &size);
[201]1067 size = sizeof(BOOL);
[551]1068 PrfQueryProfileData(fmprof, FM3Str, "OtherHelp", (PVOID) & fOtherHelp,
1069 &size);
[201]1070 size = sizeof(BOOL);
[551]1071 PrfQueryProfileData(fmprof, FM3Str, "DrivebarHelp", (PVOID) & fDrivebarHelp,
1072 &size);
[201]1073 size = sizeof(BOOL);
1074 PrfQueryProfileData(fmprof,
[551]1075 appname, "AutoAddDirs", (PVOID) & fAutoAddDirs, &size);
[201]1076 size = sizeof(BOOL);
1077 PrfQueryProfileData(fmprof,
1078 appname,
[551]1079 "AutoAddAllDirs", (PVOID) & fAutoAddAllDirs, &size);
[201]1080 size = sizeof(BOOL);
1081 PrfQueryProfileData(fmprof, FM3Str, "UserListSwitches",
1082 (PVOID) & fUserListSwitches, &size);
1083 size = sizeof(BOOL);
1084 PrfQueryProfileData(fmprof, appname, "UseNewViewer",
1085 (PVOID) & fUseNewViewer, &size);
1086 size = sizeof(BOOL);
1087 PrfQueryProfileData(fmprof, appname, "DefaultDeletePerm",
1088 (PVOID) & fDefaultDeletePerm, &size);
1089 size = sizeof(BOOL);
1090 PrfQueryProfileData(fmprof, FM3Str, "ExternalINIs",
1091 (PVOID) & fExternalINIs, &size);
1092 size = sizeof(BOOL);
1093 PrfQueryProfileData(fmprof, FM3Str, "ExternalCollector",
1094 (PVOID) & fExternalCollector, &size);
1095 size = sizeof(BOOL);
1096 PrfQueryProfileData(fmprof, FM3Str, "ExternalArcboxes",
1097 (PVOID) & fExternalArcboxes, &size);
1098 size = sizeof(BOOL);
1099 PrfQueryProfileData(fmprof, FM3Str, "ExternalViewer",
1100 (PVOID) & fExternalViewer, &size);
1101 size = sizeof(BOOL);
1102 PrfQueryProfileData(fmprof, FM3Str, "UseQProcStat",
1103 (PVOID) & fUseQProcStat, &size);
1104 size = sizeof(BOOL);
1105 PrfQueryProfileData(fmprof, FM3Str, "DataMin", (PVOID) & fDataMin, &size);
1106 size = sizeof(BOOL);
[551]1107 PrfQueryProfileData(fmprof, appname, "DataToFore", (PVOID) & fDataToFore,
1108 &size);
[201]1109 size = sizeof(BOOL);
1110 PrfQueryProfileData(fmprof, appname, "DataShowDrives",
1111 (PVOID) & fDataShowDrives, &size);
1112 size = sizeof(BOOL);
1113 PrfQueryProfileData(fmprof, appname, "DataInclRemote",
1114 (PVOID) & fDataInclRemote, &size);
1115 size = sizeof(BOOL);
[551]1116 PrfQueryProfileData(fmprof, FM3Str, "SplitStatus", (PVOID) & fSplitStatus,
1117 &size);
[201]1118 size = sizeof(BOOL);
1119 PrfQueryProfileData(fmprof, appname, "FolderAfterExtract",
1120 (PVOID) & fFolderAfterExtract, &size);
1121 size = sizeof(BOOL);
[551]1122 PrfQueryProfileData(fmprof, FM3Str, "DullDatabar", (PVOID) & fDullMin,
1123 &size);
[201]1124 size = sizeof(BOOL);
1125 PrfQueryProfileData(fmprof, appname, "BlueLED", (PVOID) & fBlueLED, &size);
1126 size = sizeof(BOOL);
[551]1127 PrfQueryProfileData(fmprof, appname, "ConfirmDelete",
1128 (PVOID) & fConfirmDelete, &size);
[201]1129 size = sizeof(BOOL);
[551]1130 PrfQueryProfileData(fmprof, FM3Str, "SaveState", (PVOID) & fSaveState,
1131 &size);
[201]1132 size = sizeof(BOOL);
[551]1133 PrfQueryProfileData(fmprof, appname, "SyncUpdates", (PVOID) & fSyncUpdates,
1134 &size);
[201]1135 size = sizeof(BOOL);
[551]1136 PrfQueryProfileData(fmprof, appname, "LoadSubject", (PVOID) & fLoadSubject,
1137 &size);
[201]1138 size = sizeof(BOOL);
[551]1139 PrfQueryProfileData(fmprof, appname, "UnHilite", (PVOID) & fUnHilite,
[201]1140 &size);
1141 size = sizeof(BOOL);
[551]1142 PrfQueryProfileData(fmprof, FM3Str, "TileBackwards",
1143 (PVOID) & fTileBackwards, &size);
[201]1144 size = sizeof(BOOL);
[551]1145 PrfQueryProfileData(fmprof, appname, "LoadLongname",
1146 (PVOID) & fLoadLongnames, &size);
1147 size = sizeof(BOOL);
1148 PrfQueryProfileData(fmprof, appname, "VerifyWrites", (PVOID) & fVerify,
1149 &size);
[201]1150 DosSetVerify(fVerify);
1151 size = sizeof(BOOL);
[551]1152 PrfQueryProfileData(fmprof, appname, "DontMoveMouse",
1153 (PVOID) & fDontMoveMouse, &size);
[201]1154 size = sizeof(BOOL);
[551]1155 PrfQueryProfileData(fmprof, appname, "NoIconsFiles",
1156 (PVOID) & fNoIconsFiles, &size);
[201]1157 size = sizeof(BOOL);
[551]1158 PrfQueryProfileData(fmprof, appname, "NoIconsDirs", (PVOID) & fNoIconsDirs,
1159 &size);
[201]1160 size = sizeof(BOOL);
[551]1161 PrfQueryProfileData(fmprof, appname, "ForceUpper", (PVOID) & fForceUpper,
1162 &size);
[201]1163 size = sizeof(BOOL);
[551]1164 PrfQueryProfileData(fmprof, appname, "ForceLower", (PVOID) & fForceLower,
1165 &size);
[201]1166 size = sizeof(BOOL);
[551]1167 PrfQueryProfileData(fmprof, FM3Str, "TextTools", (PVOID) & fTextTools,
1168 &size);
[201]1169 size = sizeof(BOOL);
[551]1170 PrfQueryProfileData(fmprof, FM3Str, "ToolTitles", (PVOID) & fToolTitles,
1171 &size);
[201]1172 size = sizeof(BOOL);
[551]1173 PrfQueryProfileData(fmprof, appname, "DoubleClickOpens", (PVOID) & fDCOpens,
1174 &size);
[201]1175 size = sizeof(BOOL);
[551]1176 PrfQueryProfileData(fmprof, appname, "LinkSetsIcon",
1177 (PVOID) & fLinkSetsIcon, &size);
[201]1178 size = sizeof(INT);
1179 PrfQueryProfileData(fmprof, appname, "Sort", (PVOID) & sortFlags, &size);
1180 size = sizeof(INT);
[551]1181 PrfQueryProfileData(fmprof, appname, "TreeSort", (PVOID) & TreesortFlags,
1182 &size);
[201]1183 size = sizeof(INT);
1184 PrfQueryProfileData(fmprof,
1185 appname,
[551]1186 "CollectorSort", (PVOID) & CollectorsortFlags, &size);
[201]1187 size = sizeof(targetdir);
[551]1188 PrfQueryProfileData(fmprof, appname, "Targetdir", (PVOID) targetdir, &size);
[201]1189 if (!IsValidDir(targetdir))
1190 *targetdir = 0;
1191 size = sizeof(extractpath);
1192 PrfQueryProfileData(fmprof,
[551]1193 appname, "ExtractPath", (PVOID) extractpath, &size);
[201]1194 if (!IsValidDir(extractpath))
1195 *extractpath = 0;
1196 size = sizeof(printer);
1197 PrfQueryProfileData(fmprof, appname, "Printer", (PVOID) printer, &size);
1198 size = sizeof(dircompare);
[551]1199 PrfQueryProfileData(fmprof, appname, "DirCompare", (PVOID) dircompare,
1200 &size);
[201]1201 size = sizeof(viewer);
1202 PrfQueryProfileData(fmprof, appname, "Viewer", (PVOID) viewer, &size);
1203 size = sizeof(editor);
1204 PrfQueryProfileData(fmprof, appname, "Editor", (PVOID) editor, &size);
1205 size = sizeof(binview);
1206 PrfQueryProfileData(fmprof, appname, "BinView", (PVOID) binview, &size);
1207 size = sizeof(bined);
1208 PrfQueryProfileData(fmprof, appname, "BinEd", (PVOID) bined, &size);
1209 size = sizeof(compare);
1210 PrfQueryProfileData(fmprof, appname, "Compare", (PVOID) compare, &size);
1211 size = sizeof(virus);
1212 PrfQueryProfileData(fmprof, appname, "Virus", (PVOID) virus, &size);
1213 size = sizeof(ftprun);
1214 PrfQueryProfileData(fmprof, appname, "FTPRun", (PVOID) ftprun, &size);
1215 if (!*ftprun && !size)
1216 strcpy(ftprun, "ftppm.exe");
1217 size = sizeof(httprun);
1218 PrfQueryProfileData(fmprof, appname, "HTTPRun", (PVOID) httprun, &size);
1219 if (!*httprun && !size)
1220 strcpy(httprun, "explore.exe -q");
1221 size = sizeof(lasttoolbox);
[551]1222 PrfQueryProfileData(fmprof, FM3Str, "LastToolBox", (PVOID) lasttoolbox,
1223 &size);
[201]1224 size = sizeof(BOOL);
[551]1225 PrfQueryProfileData(fmprof, appname, "FollowTree", (PVOID) & fFollowTree,
1226 &size);
[201]1227 size = sizeof(BOOL);
[551]1228 PrfQueryProfileData(fmprof, appname, "StartMaximized",
1229 (PVOID) & fStartMaximized, &size);
1230 if (!fStartMaximized) {
[2]1231 size = sizeof(BOOL);
[551]1232 PrfQueryProfileData(fmprof, appname, "StartMinimized",
1233 (PVOID) & fStartMinimized, &size);
[2]1234 }
[201]1235 size = sizeof(BOOL);
[551]1236 PrfQueryProfileData(fmprof, appname, "DefaultCopy", (PVOID) & fCopyDefault,
1237 &size);
[201]1238 size = sizeof(BOOL);
[551]1239 PrfQueryProfileData(fmprof, appname, "IdleCopy", (PVOID) & fRealIdle,
1240 &size);
[201]1241 size = sizeof(BOOL);
1242 PrfQueryProfileData(fmprof, appname, "ArcStuffVisible",
1243 (PVOID) & fArcStuffVisible, &size);
1244 size = sizeof(BOOL);
[551]1245 PrfQueryProfileData(fmprof, FM3Str, "NoTreeGap", (PVOID) & fNoTreeGap,
[201]1246 &size);
1247 size = sizeof(BOOL);
[551]1248 PrfQueryProfileData(fmprof, FM3Str, "VTreeOpensWPS",
1249 (PVOID) & fVTreeOpensWPS, &size);
[201]1250 size = sizeof(BOOL);
[551]1251 PrfQueryProfileData(fmprof, appname, "RemoteBug", (PVOID) & fRemoteBug,
[201]1252 &size);
1253 size = sizeof(BOOL);
[551]1254 PrfQueryProfileData(fmprof, appname, "Drag&DropDlg",
1255 (PVOID) & fDragndropDlg, &size);
1256 size = sizeof(BOOL);
[201]1257 PrfQueryProfileData(fmprof, FM3Str, "UserComboBox", (PVOID) & fUserComboBox,
1258 &size);
1259 size = sizeof(BOOL);
1260 PrfQueryProfileData(fmprof, FM3Str, "MinDirOnOpen", (PVOID) & fMinOnOpen,
1261 &size);
1262 size = sizeof(BOOL);
[551]1263 PrfQueryProfileData(fmprof, appname, "QuickArcFind",
1264 (PVOID) & fQuickArcFind, &size);
[201]1265 size = sizeof(BOOL);
[551]1266 PrfQueryProfileData(fmprof, FM3Str, "NoRemovableScan",
1267 (PVOID) & fNoRemovableScan, &size);
1268 size = sizeof(ULONG);
1269 PrfQueryProfileData(fmprof, FM3Str, "NoBrokenNotify",
1270 (PVOID) & NoBrokenNotify, &size);
1271 size = sizeof(ULONG);
1272 PrfQueryProfileData(fmprof, appname, "ContainerType", (PVOID) & ulCnrType,
[201]1273 &size);
1274 size = sizeof(ULONG);
[796]1275 PrfQueryProfileData(fmprof, appname, "FilesToGet", (PVOID) &FilesToGet,
[201]1276 &size);
[789]1277 if (FilesToGet < FILESTOGET_MIN)
1278 FilesToGet = FILESTOGET_MIN;
1279 else if (FilesToGet > FILESTOGET_MAX)
1280 FilesToGet = FILESTOGET_MAX;
[201]1281 size = sizeof(BOOL);
1282 PrfQueryProfileData(fmprof, FM3Str, "AutoView", (PVOID) & fAutoView, &size);
1283 size = sizeof(BOOL);
[551]1284 PrfQueryProfileData(fmprof, FM3Str, "FM2Deletes", (PVOID) & fFM2Deletes,
1285 &size);
[2]1286
[784]1287 size = sizeof(BOOL);
1288 PrfQueryProfileData(fmprof, appname, "DetailsLWDate", (PVOID) &detailslwdate,
1289 &size);
1290 size = sizeof(BOOL);
1291 PrfQueryProfileData(fmprof, appname, "DetailsLWTime", (PVOID) &detailslwtime,
1292 &size);
1293 size = sizeof(BOOL);
1294 PrfQueryProfileData(fmprof, appname, "DetailsLADate", (PVOID) &detailsladate,
1295 &size);
1296 size = sizeof(BOOL);
1297 PrfQueryProfileData(fmprof, appname, "DetailsLATime", (PVOID) &detailslatime,
1298 &size);
1299 size = sizeof(BOOL);
1300 PrfQueryProfileData(fmprof, appname, "DetailsCRDate", (PVOID) &detailscrdate,
1301 &size);
1302 size = sizeof(BOOL);
1303 PrfQueryProfileData(fmprof, appname, "DetailsCRTime", (PVOID) &detailscrtime,
1304 &size);
1305 size = sizeof(BOOL);
1306 PrfQueryProfileData(fmprof, appname, "DetailsLongname", (PVOID) &detailslongname,
1307 &size);
1308 size = sizeof(BOOL);
1309 PrfQueryProfileData(fmprof, appname, "DetailsEA", (PVOID) &detailsea,
1310 &size);
1311 size = sizeof(BOOL);
1312 PrfQueryProfileData(fmprof, appname, "DetailsSize", (PVOID) &detailssize,
1313 &size);
1314 size = sizeof(BOOL);
1315 PrfQueryProfileData(fmprof, appname, "DetailsSubject", (PVOID) &detailssubject,
1316 &size);
1317 size = sizeof(BOOL);
1318 PrfQueryProfileData(fmprof, appname, "DetailsAttr", (PVOID) &detailsattr,
1319 &size);
1320 size = sizeof(BOOL);
1321 PrfQueryProfileData(fmprof, appname, "DetailsIcon", (PVOID) &detailsicon,
[796]1322 &size);
1323 size = sizeof(BOOL);
1324 PrfQueryProfileData(fmprof, appname, "SubjectInLeftPane", (PVOID) &fSubjectInLeftPane,
1325 &size);
1326 size = sizeof(ULONG);
1327 PrfQueryProfileData(fmprof, appname, "SubjectDisplayWidth", (PVOID) &SubjectDisplayWidth,
[784]1328 &size);
[796]1329 if (SubjectDisplayWidth < 50)
1330 SubjectDisplayWidth = 0;
1331 else if (SubjectDisplayWidth > 1000)
1332 SubjectDisplayWidth = 1000;
1333 size = sizeof(BOOL);
1334 PrfQueryProfileData(fmprof, appname, "SubjectLengthMax", (PVOID) &fSubjectLengthMax,
1335 &size);
[784]1336
[2]1337 /* load pointers and icons we use */
[189]1338 hptrArrow = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE);
1339 hptrBusy = WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE);
1340 hptrNS = WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZENS, FALSE);
1341 hptrEW = WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZEWE, FALSE);
1342 hptrFloppy = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FLOPPY_ICON);
1343 hptrDrive = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DRIVE_ICON);
1344 hptrRemovable = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, REMOVABLE_ICON);
1345 hptrCDROM = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, CDROM_ICON);
1346 hptrFile = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_ICON);
1347 hptrDir = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DIR_FRAME);
1348 hptrArc = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ARC_FRAME);
1349 hptrArt = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ART_ICON);
1350 hptrSystem = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_SYSTEM_ICON);
1351 hptrHidden = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_HIDDEN_ICON);
[552]1352 hptrReadonly = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_READONLY_ICON);
[189]1353 hptrLast = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, LASTITEM_ICON);
1354 hptrRemote = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, REMOTE_ICON);
[552]1355 hptrVirtual = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, VIRTUAL_ICON);
1356 hptrRamdisk = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, RAMDISK_ICON);
[189]1357 if (!fNoDead)
1358 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER_ICON);
[2]1359 else
[189]1360 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER2_ICON);
1361 hptrApp = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, APP_ICON);
1362 hptrDunno = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DUNNO_ICON);
1363 hptrEnv = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ENV_ICON);
1364 hptrZipstrm = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ZIPSTREAM_ICON);
[2]1365
[201]1366 // set up color array used by seeall.c and newview.c color dialog
1367
[189]1368 standardcolors[0] = CLR_WHITE;
1369 standardcolors[1] = CLR_BLACK;
1370 standardcolors[2] = CLR_BLUE;
1371 standardcolors[3] = CLR_RED;
1372 standardcolors[4] = CLR_PINK;
1373 standardcolors[5] = CLR_GREEN;
1374 standardcolors[6] = CLR_CYAN;
1375 standardcolors[7] = CLR_YELLOW;
1376 standardcolors[8] = CLR_DARKGRAY;
1377 standardcolors[9] = CLR_DARKBLUE;
[2]1378 standardcolors[10] = CLR_DARKRED;
1379 standardcolors[11] = CLR_DARKPINK;
1380 standardcolors[12] = CLR_DARKGREEN;
1381 standardcolors[13] = CLR_DARKCYAN;
1382 standardcolors[14] = CLR_BROWN;
1383 standardcolors[15] = CLR_PALEGRAY;
1384
1385 return TRUE;
1386}
1387
[189]1388HWND StartFM3(HAB hab, INT argc, CHAR ** argv)
1389{
[201]1390 HWND hwndFrame;
1391 HWND hwndClient;
1392 UINT x;
[189]1393 ULONG FrameFlags = FCF_TITLEBAR | FCF_SYSMENU |
[551]1394 FCF_SIZEBORDER | FCF_MINMAX |
1395 FCF_ACCELTABLE | FCF_MENU | FCF_ICON | FCF_TASKLIST | FCF_NOBYTEALIGN;
[2]1396
[551]1397 for (x = 1; x < argc; x++) {
[201]1398 if (*argv[x] == '~' && !argv[x][1])
1399 fReminimize = TRUE;
1400 if (*argv[x] == '+' && !argv[x][1])
1401 fLogFile = TRUE;
[551]1402 if (*argv[x] == '-') {
[201]1403 if (!argv[x][1])
1404 fNoSaveState = TRUE;
1405 else
1406 strcpy(profile, &argv[x][1]);
[2]1407 }
1408 }
1409
1410 hwndFrame = WinCreateStdWindow(HWND_DESKTOP,
[189]1411 WS_VISIBLE,
1412 &FrameFlags,
[593]1413 WC_MAINWND,
[189]1414 NULL,
1415 WS_VISIBLE | WS_ANIMATE,
[551]1416 FM3ModHandle, MAIN_FRAME, &hwndClient);
1417 if (hwndFrame) {
1418 WinSetWindowUShort(hwndFrame, QWS_ID, MAIN_FRAME);
1419 if (!WinRestoreWindowPos(FM2Str, "MainWindowPos", hwndFrame)) {
[2]1420
1421 ULONG fl = SWP_MOVE | SWP_SIZE;
1422 RECTL rcl;
[189]1423 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 3L;
1424 ULONG bsz = WinQuerySysValue(HWND_DESKTOP, SV_CYSIZEBORDER);
[2]1425
[551]1426 WinQueryWindowRect(HWND_DESKTOP, &rcl);
[2]1427 rcl.yBottom += icz;
1428 rcl.yTop -= bsz;
1429 rcl.xLeft += bsz;
1430 rcl.xRight -= bsz;
1431 WinSetWindowPos(hwndFrame,
[189]1432 HWND_TOP,
1433 rcl.xLeft,
1434 rcl.yBottom,
[551]1435 rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom, fl);
[2]1436 }
[189]1437 if (fLogFile)
[551]1438 LogFileHandle = _fsopen("FM2.LOG", "a+", SH_DENYWR);
[189]1439 if (hwndHelp)
[551]1440 WinAssociateHelpInstance(hwndHelp, hwndFrame);
1441 PostMsg(hwndClient, UM_SETUP, MPFROMLONG(argc), MPFROMP(argv));
[2]1442 }
1443 return hwndFrame;
1444}
[32]1445
[189]1446int CheckVersion(int vermajor, int verminor)
1447{
[179]1448 int ok = 0;
[32]1449
[179]1450 // fixme to do useful check - was missing in base source
1451
[32]1452#if 0
[551]1453 if (vermajor && verminor) {
[32]1454 *vermajor = VERMAJOR;
1455 *verminor = VERMINOR;
[179]1456 ok = 1;
[32]1457 }
1458#endif
[189]1459
[179]1460 ok = 1;
[32]1461
[179]1462 return ok;
[32]1463}
[783]1464
1465#ifdef __WATCOMC__
1466#pragma alloc_text(INIT,LibMain,InitFM3DLL,DeInitFM3DLL)
1467#pragma alloc_text(INIT1,StartFM3,FindSwapperDat)
1468#endif
1469
Note: See TracBrowser for help on using the repository browser.