Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete file recycle in FPW 2.6
Message
From
05/04/2002 05:55:52
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00641063
Message ID:
00641284
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
>Do you know a way to send a file to the recycle bin in FPW 2.6?

Could this help you?
Send a file to the Recycle Bin of Windows 95:
In the General Declarations area of a basic module place:
Public Type SHFILEOPSTRUCT
    hwnd As Long
    wFunc As Long
    pFrom As String
    pTo As String
    fFlags As Integer
    fAnyOperationsAborted As Boolean
    hNameMappings As Long
    lpszProgressTitle As String
End Type
Public Declare Function SHFileOperation Lib "shell32.dll" Alias _
	"SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Public Const F0_DELETE = &H3
Public Const F0F_ALLOWUNDO = &H40
' Explorer type dialog
Public Const FOF_CREATEPROGRESSDLG As Long = &H0
In a new function procedure of the above module place:
Public Function DelToRecycleBin(FileName As String) As Boolean
Dim FileOperation As SHFILEOPSTRUCT
Dim lReturn As Long
On Error GoTo DelToRecycleBin_Err
With FileOperation
    .wFunc = F0_DELETE
    .pFrom = FileName
    .fFlags = F0F_ALLOWUNDO + F0F_CREATEPROGRESSDLG
End With
lReturn = SHFileOperation(FileOperation)
If lReturn <> 0 Then
    DelToRecycleBin = False
Else
    DelToRecycleBin = True
End If
Exit Function
DelToRecycleBin_Err:
DelToRecycleBin = False
MsgBox Err.Description
End Function
In the click event of a commandbutton or any event you want place:
DelToRecycleBin ("c:\test.txt")
(this assumes there is a file named test.txt in the c-root drive)
For More Information Contact:
Computer Consulting
CompanyAddress
Tel: CompanyPhone
FAX: CompanyFAX
Internet: CompanyEmail

Email Us

Send mail to CompanyWebmaster with questions or comments about this web site.
Copyright © 1996 Computer Consulting
Last modified: September 03, 2001 
José Luis.

Quidquid latine dictum sit, altum sonatur

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform