4
Contributors
7
Replies
8
Views
9 Years
Discussion Span
Last Post by choudhuryshouvi
Featured Replies
  • 5

    Try This Following Code : [code=vb]private declare function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long,ByVal pszRootPath As String,ByVal dwFlags As Long) As Long Private Const SHERB_NORMAL = &H10 Private Const SHERB_NOCONFIRMATION = &H1 Private Const SHERB_NOPROGRESSUI = &H2 Private Const SHERB_NOSOUND = &H4 Private Const SHERB_NOALL = _ … Read More

  • check this sample and give your feedback regards Shouvik Read More

  • 1

    Ok. Happy coding friend :) Read More

0

i know the api function for this but i didn't know how to use it.

SHEmptyRecycleBin

Anyone know how to use this api function to clean recycle bin???

5

Try This Following Code :

private declare function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long,ByVal pszRootPath As String,ByVal dwFlags As Long) As Long
Private Const SHERB_NORMAL = &H10
Private Const SHERB_NOCONFIRMATION = &H1
Private Const SHERB_NOPROGRESSUI = &H2
Private Const SHERB_NOSOUND = &H4
Private Const SHERB_NOALL = _
(SHERB_NOCONFIRMATION And _
SHERB_NOPROGRESSUI And SHERB_NOSOUND)

Dim RetVal As Long
Private Sub Command1_Click()
   Dim y as Integer
   y = MsgBox("Are u sure to clean up Recycle Bin ? ", vbYesNo, "Confirmation"
   If y = vbYes Then
      RetVal = SHEmptyRecycleBin(0&,vbNullString,&H1)
   MsgBox "Recycle Bin has been cleaned"
   End If
End Sub

Ok. Hope This Helps.

Votes + Comments
Good
Great coding.....
Perfect :)
0

thx jx_man its working nice. :)
thanks Shouvik for your example program. :)

0

hi all..
how can i zip and unzip a file using SharpzipLib.Dll.
Can any one help me?.
Thanks in advance...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.