source: trunk/dll/init.c@ 878

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

Added "Save as" and readonly file handling to internal editor; clean up ext path not checked on start up; Updated history.

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