|
|
|
You can use the ShellExecute API function to programmatically open a window of Explorer and display the contents of the Recycle Bin. This is the function's declare: |
Click here to copy the following block | Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _ ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long |
The first parameter is the handle of parent window, the second is the action to be peerformed (in our case is "open"), the third argument is the application to execute, the fourth is the command line for the application, the fifth is the default directory. The last specifies the style of the window (maximized, normal or minimized), and you can use the same constants accepted by VB's Shell function. As you see in the following code, the trick is to specify the special GUID of the Recicly Bin in the command string passed to Explorer: |
The user can then select the Empty Recycle Bin command from the File menu to manually empty the Recycle Bin, if desired.
|
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|