(*--------------------------------------------------------------------------* * DefIconer | Version 1.0 | released - 24.04.94 * * Creates an appmenu from which the user can give files default icons * * Lee Kindness - 8 Craigmarn Rd. Portlethen. ABERDEEN AB1 4QR SCOTLAND * * * * DefIconer.PAS * * * *--------------------------------------------------------------------------*) Program DefIconer; {$F-,I-,R-,S-,V-,M 2,1,1,15} USES Exec, Intuition, Commodities, Icon, Workbench, Rexx, Init, DOS, Amiga, Graphics, AmigaDOS; TYPE tProgVars = Record TEXT : String[80]; REXXPORT : String[80]; REXXCMD : String[80]; REXX : Boolean; End; {tProgVars} pStrNode = ^tStrNode; tStrNode = record sn_node : tNode; sn_Name : String; sn_Lock : BPTR; end; CONST V : tProgVars = (TEXT : 'Default Icon'; REXXPORT : 'PLAY'; REXXCMD : 'id DEFICONER_SELECT'; REXX : True); RKey : pRemember = NIL; Version : String[45] = '$VER: DefIconer 1.1 (18.06.94) ŠLee Kindness'#0; function CStrConstPtrAR(rk : ppRemember; s : String) : STRPTR; type a = packed array [0..255] of char; var p : ^a; begin s := s + #0; { Make "C" string } p := AllocRemember(rk, length(s), MEMF_CLEAR); { Get some mem for it } move(s[1], p^, length(s)); { Move s into newly alloc'd mem } CStrConstPtrAR := STRPTR(p); { Return the pointer } end; {$I ToolType.PAS} {$I IDPort.PAS} {$I RexxMsg.PAS} {$I ProcessMsg.PAS} {$I AppMenu.PAS} Procedure Main; VAR IDPort, AppPort : pMsgPort; AppMenu : pAppMenuItem; Begin IntuitionBase := pIntuitionBase(OpenLibrary('intuition.library',0)); If IntuitionBase <> NIL then begin IconBase := OpenLibrary('icon.library',37); If IconBase <> NIL then begin WorkBenchBase := OpenLibrary('workbench.library',37); If WorkbenchBase <> NIL then begin RexxSysBase := OpenLibrary('rexxsyslib.library',0); if CheckIDPortOrSetup(IDPort) then begin GetToolTypes(V); IF InitAppICons(V, AppPort, AppMenu) then begin ProcessMessage(IDPort, AppPort); CleanAppMenu(AppPort,AppMenu); end; CleanIDPort(IDPort); end; CloseLibrary(pLibrary(RexxSysBase)); CloseLibrary(pLibrary(WorkBenchBase)); End; {WBBase <> NIL} CloseLibrary(pLibrary(IconBase)); End; {IconBase <> NIL} FreeRemember(@RKey, True); CloseLibrary(pLibrary(IntuitionBase)); End; {IntuitionBase <> NIL} End; Begin Main; End.