2 * saveicon.h Public protos for functions to deal with saving icons
8 * 20010804 DM + Created. Added one function to save an icon (currently only
9 * saves a default projet icon) for a file, if the file exists.
13 #include <exec/types.h>
15 #include <proto/exec.h>
16 #include <proto/dos.h>
17 #include <proto/icon.h>
19 #include <workbench/workbench.h>
22 BOOL
SaveIcon(STRPTR filename
)
26 struct DiskObject
*ico
; /* Icon to save */
30 /* Make sure file exists */
31 flock
= Lock(filename
, ACCESS_READ
);
36 if(NULL
!= (IconBase
= OpenLibrary("icon.library", 36)) )
38 ico
= GetDefDiskObject(WBPROJECT
);
41 saved
= PutDiskObject(filename
, ico
);
44 CloseLibrary(IconBase
);