Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete file recycle in FPW 2.6
Message
 
To
05/04/2002 05:55:52
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00641063
Message ID:
00641367
Views:
16
That can help if somebody can explain how to pass this structure to Foxtool's REGFN()...



>>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.
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform