forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deleting files to the Recycle Bin

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase
View previous topic :: View next topic  
Author Message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 169
Location: Manchester

PostPosted: Sun Sep 05, 2004 6:59 pm    Post subject: Deleting files to the Recycle Bin Reply with quote

Summary
FTN95 does not currently provide a method for deleting files to the recycle bin.

Solution

The Windows API routine "SHFileOperation" can be used to delete files to the recycle bin.

This routine takes a structure as it's only argument which contains all the information on which file(s) to delete and whether to display a dialog box etc. An example of using this routine follows:

Code:

program recycle_bin_test
include <windows.ins>

type shFileOpStruct
sequence
integer*4 :: hWnd = 0
integer*4 :: wFunc = 0
integer*4 :: pFrom = 0
integer*4 :: pTo = 0
integer*2 :: fFlags = 0
integer*4 :: fAnyOperationsAborted = 0
integer*4 :: hNameMappings = 0
integer*4 :: lpszProgressTitle = 0
end type

integer, parameter :: FO_DELETE = 3
integer, parameter :: FOF_ALLOWUNDO = 64

type(shFileOpStruct) op
character*1024 opFilename
integer opResult

op%wFunc = FO_DELETE
opFilename = "tempfile.txt"//char(0)//char(0)
op%pFrom = loc(opFilename)
op%fFlags = FOF_ALLOWUNDO
opResult = SHFileOperation(op)
end


For more information on this routine please see Microsoft's documentation at [url="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shfileoperation.asp"]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shfileoperation.asp[/url]
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group