Newsgroup: it.comp.lang.visual-basic
Titolo: REQ :Gestione del cestino

Ho un problema nel capire come funziona la gestione del cestino del gestione
risorse.
Utilizza due file invisibili che hanno le informazioni inerenti ai file
eliminati.
Come viene gestito tutto ciň?
Come posso, in VB, spostare i file nel cestino e ripristinarli?
Grazie
Sergio

>Come posso, in VB, spostare i file nel cestino e ripristinarli?
Per questo mi sembra ci sia un help, lo havevo visto su un sito chhe
si chiamava VB thunder o qualcosa del genere..
L'indirizzo me lo aveva dato qualcuno qui sul NG, se ve lo ricordate,
rendetelo noto ! C'erano cose belle...
Ciao.
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
 -----------Federico Emanuele Galli----------
 ----------Visual Basic's Programmer---------
 
 Sideralis Programs (Visual-Basic and Delphi)
 
http://www.geocities.com/colosseum/loge/2151
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
                 Trust no ONE.
Per rispondermi via E-Mail togli STOPSPAMMERS.
Guarda la RFD per it.comp.prog.collaborazione !

Chiedo scusa per il messaggione.
Questo sorgente proviene da 
msvp.com
 (sito CCRP) e dovrebbe fare al caso
tuo.
===========================================================0
Visual Basic System Services
Posted Tuesday January 13, 1997
Updated Thursday July 02, 1998
Recycle Bin Management Related Topics
   VBnet Frames
Applies to: VB4-32 and VB5 under Win32 with IE4 Active Desktop
Prerequisites
The initial reports of users experiencing difficulty with this routine
appear to be justified. The SHQueryRecycleBin API used in this method is
only available on systems with the latest shell32.dll installed with IE4 /
Active Desktop.
----------------------------------------------------------------------------
----
Many have written asking about Recycle Bin routines.  Here, the
SHQueryRecycleBin API is used to determine the contents of the bins, and the
SHEmptyRecycleBin API dumps the contents, based on flags set by the user.
In addition, the code demonstrates using the ShellExecute API to open
Explorer at the C:\ folder in 'explore' mode (both treeview and listview
displayed), and to open the Recycle Bin with the 'open' verb (listview
only), using the Recycle Bin's registry CLSID.
Start a new project, and copy the following code as indicated. To assure
that the returns in the page are preserved, remember to include the '--end
block--' text in the copy.
BAS Module Code
Place the following code into the general declarations area of a bas module:
----------------------------------------------------------------------------
----
Option Explicit
Type myLong64
   var1 As Long
   var2 As Long
End Type
Public Type SHQUERYRBINFO
   cbSize         As Long
   i64Size        As myLong64
   i64NumItems    As myLong64
End Type
Public Const SW_NORMAL = 1
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWDEFAULT = 10
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1
Public Const HWND_DESKTOP = 0
Public Const SHERB_NOCONFIRMATION = &H1
Public Const SHERB_NOPROGRESSUI = &H2
Public Const SHERB_NOSOUND = &H4
Public 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
Public Declare Function SHQueryRecycleBin _
   Lib "shell32" Alias "SHQueryRecycleBinA" _
   (ByVal pszRootPath As String, _
    pSHQueryRBInfo As SHQUERYRBINFO) As Long
Public Declare Function SHEmptyRecycleBin _
   Lib "shell32" Alias "SHEmptyRecycleBinA" _
   (ByVal hwnd As Long, _
    ByVal pszRootPath As String, _
    ByVal dwFlags As Long) As Long
'--end block--'
Form Code
To a form, add 3 check buttons in a control array (chkSHOptions(0) -
chkSHOptions(2)) with the captions as shown in the illustration. Set their
initial values to 0. Add 5 command buttons (cmdOpenExplorer(0),
cmdOpenExplorer(1), cmdRequeryBin, cmdEmptyBucket and cmdEnd), and a label
(Label1).
----------------------------------------------------------------------------
----
Option Explicit
Private Function GetBitBucketCount() As Long
   Dim SHQBI As SHQUERYRBINFO
   Dim r As Long
   With SHQBI
      .cbSize = LenB(SHQBI)
   End With
   r = SHQueryRecycleBin(vbNullString, SHQBI)
   GetBitBucketCount = (SHQBI.i64NumItems.var1 + SHQBI.i64NumItems.var2)
End Function
Private Sub cmdEmptyBucket_Click()
   EmptyBitBucket
End Sub
Private Function EmptyBitBucket(Optional drvBin As String)
   Dim r As Long
   Dim flags As Long
  'if a specific bin is nor passed,
  'then set the drvBin to a null string
  'to perform the action on all bins
   If drvBin = "" Then
      drvBin = vbNullString
   End If
  'set the option flags based on the
  'check buttons
   If chkSHOptions(0).Value = 1 Then flags = SHERB_NOCONFIRMATION
   If chkSHOptions(1).Value = 1 Then flags = flags + SHERB_NOPROGRESSUI
   If chkSHOptions(2).Value = 1 Then flags = flags + SHERB_NOSOUND
  'empty the bin
   r = SHEmptyRecycleBin(Me.hwnd, drvBin, flags)
   DoEvents
  'and update the stats by setting
  'the value property of the
  'requery button to true
   cmdRequeryBin = True
End Function
Private Sub cmdEnd_Click()
   Unload Me
   Set Form1 = Nothing
End Sub
Private Sub cmdOpenExplorer_Click(Index As Integer)
   Dim r As Long
   Dim sCommand As String
   Select Case Index
      Case 0: 'Win95 class ID of the Recycle Bin
              sCommand = "/root,::{645FF040-5081-101B-9F08-00AA002F954E}"
      Case 1: sCommand = "/e,c:\"
   End Select
  r = ShellExecute(HWND_DESKTOP, "Open", "explorer.exe", _
                   sCommand, 0&, SW_SHOWNORMAL)
End Sub
Private Sub cmdRequeryBin_Click()
   Dim binCount As Long
   binCount = GetBitBucketCount()
   If binCount Then
         Label1 = "The Recycle Bin contains " & binCount & " items."
   Else: Label1 = "The Recycle Bin is empty."
   End If
   cmdEmptyBucket.Enabled = binCount > 0
End Sub
Private Sub Form_Load()
  'get the bin stats by setting
  'the value property of the
  'requery button to true
   cmdRequeryBin = True
End Sub
'--end block--'
Comments
Save & run the project.  Pressing the Open Recycle Bin button will display
the bin as though the icon was double clicked.  Pressing Explore C: opens a
normal explorer window rooted at C:\.
The Requery Bin Status button is used to update the label and to activate
the Empty Recycle Bin button when disabled.  The button will only enable
when the bin has contents.
Selecting the first checkbox will turn off the "Do you want to delete"
prompt; the bin will empty without confirmation. For deleting a large number
of files, the second checkbox prevents the flying garbage AVI progress
dialog.  The third option suspends the confirmation sound if set up on your
system.
----------------------------------------------------------------------------
----

si chiamava VB thunder o qualcosa del genere..
Ho trovato il sito, 
http://www.cyberhighway.net/~psy/index.html
 , ma c'e'
soltanto un modulo per spostare i file nel cestino e poi eliminarli. Io ho
bisogno anche di ripristinarli e di sapere precisamente come viene
effettuata la gestione. Sai dove posso trovare una documentazione tecnica?
Ciao e grazie...