How To Delete a File into the Win95/98/Me Recycle Bin (154005)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q154005 SUMMARY
The Visual Basic function called KILL enables a user to delete a file from disk. Under Windows 95, Windows 98, Windows Me, Windows NT 4.0, and Windows 2000, files can be deleted into the Recycle Bin, giving a user the ability to reclaim deleted items. The KILL function does not offer this functionality to the Visual Basic Programmer. This article describes how to use the SHFileOperation Win32 API to enable a user to delete a file and place it in the Recycle Bin. Below is a code sample showing how to use the API in Visual Basic.
The Recycle Bin option to remove files immediately when deleted should be turned off in order for this sample to function as designed.
REFERENCES
The Win32 SDK Helpfile refers to other SHFileOperation functionality.
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbAPI kbhowto KB154005 |
---|
|