CodeItBetter Programming Another VB Programming Blog

How to Open Recycle Bin

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'System & API - How to Open Recycle Bin
Option Explicit
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
Private Const SW_SHOWNORMAL As Long = 1
 
Sub Main()
    Call ShowRecycleBin
End Sub
 
Public Function ShowRecycleBin() As Boolean
    Dim lRet As Long
    'if using from a form, you can use me.hwnd instead of 0& for the first argument
    lRet = ShellExecute(0&, "Open", "explorer.exe", _
        "/root,::{645FF040-5081-101B-9F08-00AA002F954E}", 0&, SW_SHOWNORMAL)
    ShowRecycleBin = lRet > 32
End Function
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.