|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Empty Recycle bin - VB.NET codeHi All
Can Anybody Please help me in how to Empty a Recycle bin using VB.NET code ? Regards Vighneswar Hello vighnesh,
> Hi All I believe that you need to P/Invoke for this functionality. Good news is > > Can Anybody Please help me in how to Empty a Recycle bin using VB.NET > code ? that there is a sample up on Pinvoke.net to do this very thing. http://www.pinvoke.net/default.aspx/shell32/SHEmptyRecycleBin.html -- Jared Parsons [MSFT] jared***@online.microsoft.com All opinions are my own. All content is provided "AS IS" with no warranties, and confers no rights. This is how you do it:
Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hWnd As Int32, ByVal pszRootPath As String, ByVal dwFlags As Int32) As Int32 Private Declare Function SHUpdateRecycleBinIcon Lib "shell32.dll" () As Int32 Private Const SHERB_NOCONFIRMATION = &H1 Private Const SHERB_NOPROGRESSUI = &H2 Private Const SHERB_NOSOUND = &H4 #Region "Empty Recycle Bin (SUB)" Private Sub EmptyRecycleBin() SHEmptyRecycleBin(Me.Handle.ToInt32, vbNullString, SHERB_NOCONFIRMATION + SHERB_NOSOUND) SHUpdateRecycleBinIcon() End Sub #End Region I hope this helps, Crouchie1998 MCP MCSE Show quoteHide quote "vighnesh" <vighn***@nannacomputers.com> wrote in message news:enD3rWeoGHA.3452@TK2MSFTNGP05.phx.gbl... > Hi All > > Can Anybody Please help me in how to Empty a Recycle bin using VB.NET code ? > > Regards > Vighneswar > >
Date Sort
Sharing Class Data With Multiple Forms Scrolling DataGrid's selected row out of view selects next control How to Get DataSet ot DataTable from DataGrid Difference between MyBase and Me Limit bandwith of my application VB Net 2005 and Email! Need to capture all keystrokes to my application Images in a Windows DataGrid combobox view display width question |
|||||||||||||||||||||||