home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-19 | 1.6 KB | 59 lines | [TEXT/PJMM] |
- unit MySystemGlobals;
-
- interface
-
- {$IFC undefined THINK_Pascal}
- uses
- Files;
- {$ENDC}
-
- var { set up by InitSystemGlobals }
- system7: boolean;
- system_version: longInt;
- has_appleEvents: boolean;
- has_findfolder: boolean;
- has_aliasMgr: boolean;
- has_newStdFile: boolean;
- has_HelpMgr: boolean;
- has_colorQD: boolean;
- app_resfile: integer;
- app_fs: FSSpec;
-
- procedure InitSystemGlobals;
-
- implementation
-
- {$IFC undefined THINK_Pascal}
- uses
- Resources, GestaltEqu;
- {$ENDC}
-
- {$S Init}
- procedure InitSystemGlobals;
- var
- oe: OSErr;
- gv: longInt;
- pb: FCBPBRec;
- sysenv: sysEnvRec;
- begin
- app_resfile := CurResFile;
- pb.ioNamePtr := @app_fs.name;
- pb.ioVRefNum := 0;
- pb.ioRefNum := app_resfile;
- pb.ioFCBIndx := 0;
- oe := PBGetFCBInfo(@pb, false);
- app_fs.vRefNum := pb.ioFCBVRefNum;
- app_fs.parID := pb.ioFCBParID;
- has_colorqd := (SysEnvirons(1, sysEnv) = noErr) & sysenv.hasColorQD; { Gestalt has a bug that causes hasColourQD to always be set }
- if (Gestalt(gestaltSystemVersion, system_version) <> noErr) then begin
- system_version := $0600;
- end;
- system7 := system_version >= $0700;
- has_AppleEvents := (Gestalt(gestaltAppleEventsAttr, gv) = noErr) & (BTST(gv, gestaltAppleEventsPresent));
- has_findfolder := (Gestalt(gestaltFindFolderAttr, gv) = noErr) & (BTST(gv, gestaltFindFolderPresent));
- has_newStdFile := (Gestalt(gestaltStandardFileAttr, gv) = noErr) & (BTST(gv, gestaltStandardFile58));
- has_HelpMgr := (Gestalt(gestaltHelpMgrAttr, gv) = noErr) & (BTST(gv, gestaltHelpMgrPresent));
- has_aliasMgr := (Gestalt(gestaltAliasMgrAttr, gv) = noErr) & (BTST(gv, gestaltAliasMgrPresent));
- end;
-
- end.