home *** CD-ROM | disk | FTP | other *** search
- program Transfer;
-
- {This program implements a desk accessory that allows you to
- transfer to another application.
-
- Richard Siegel
- March 7, 1986
-
- Copying is allowed for noncommercial and personal use only.
- }
-
- {This file should be saved as "Transfer.pas"}
-
- {$i MemTypes.ipas}
- {$i QuickDraw.ipas}
- {$i OSIntf.ipas}
- {$i ToolIntf.ipas}
- {$i PackIntf.ipas}
-
- TYPE
- pLaunchStruct = ^LaunchStruct;
- LaunchStruct = record
- pfName: ^Str255;
- param: integer;
- End; {LaunchStruct}
-
- DAGlobals = record
- Reply : SFReply;
- ValidTypes : SFTypeList;
- volRef : Integer;
- Location : Point;
- prompt : Str255;
- pMyLaunch: pLaunchStruct;
- myLaunch: LaunchStruct;
- fName: Str255;
- err : OSErr;
- end;
-
- DAGlobalsPtr = ^DAGlobals;
- DAGlobalsHandle = ^DaGlobalsPtr;
-
-
- Procedure Open(var Device : DCtlEntry; var Block : PAramBlockRec);
-
- var
- DaGlobalsHndl : DAGlobalsHandle;
- DAGlobalsRec : DAGlobals;
-
- Procedure Launch; INLINE $A9F2;
- PROCEDURE LaunchIt(pLnch: pLaunchStruct); INLINE $205F;
-
- begin
-
- Device.DCtlStorage := NewHandle(SizeOf(DAGlobalsRec));
- HLock(Device.DCtlStorage);
-
- DAGlobalsHndl := DAGlobalsHandle(Device.DCtlStorage);
-
- with DAGlobalsHndl^^ do begin
- with Location do begin
- h := 60;
- v := 60;
- end;
-
- validTypes[0] := 'APPL';
-
- SFGetFile(Location, prompt, NIL, 1, validTypes, NIL, Reply);
- if Reply.good then begin
- err := SetVol(NIL, Reply.vRefNum);
- pMyLaunch:= @myLaunch;
- With pMyLaunch^ do Begin
- pfName:= @Reply.fName; {pointer to our fileName}
- param:= 0; {we don't want alternate screen or sound buffers}
- End; {With}
- LaunchIt(pMyLaunch);
- Launch;
- end;
- end;
- end;
-
- procedure Close(var Device : DCtlEntry; var Block : PAramBlockRec);
- begin
- end;
-
- procedure Ctl(var Device : DCtlEntry; var Block : PAramBlockRec);
- begin
- end;
-
- begin
- end.
-
- ------------------------Cut Here-------------------
-
- *The RMaker source file looks like this:
-
- *RMaker source to create desk accessory file
- *Richard Siegel
- *March 7, 1986
- * This file should be saved as Transfer.R
-
- Transfer DA
- DFILDMOV
-
- TYPE DRVR = PROC
- Transfer, 20
- pds2:Transfer *Make the disk name whichever disk you want the file
- *to be stored on
-
- ------
-