System.Shell.RecycleBin.onRecycleBinChanged event

[ The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Event fired when the content of the Recycle Bin is modified.

Syntax

iRetVal = System.Shell.RecycleBin.onRecycleBinChanged(
  handler
)

Parameters

handler

The name of the function to call when the event is fired.

Remarks

This event is triggered when fileCount or folderCount changes.

The Recycle Bin must be open for this event to be fired.

This event may be triggered multiple times; this will require some management depending on gadget functionality.

Examples

The following example demonstrates how to display user feedback when the Recycling Bin contents are modified.

// Member variables.
var intRecycleBinFileCount = System.Shell.RecycleBin.fileCount;
var intRecycleBinFolderCount = System.Shell.RecycleBin.folderCount;
var bRecycleBinChangeHandled = false;

// Recycle Bin event handler.
System.Shell.RecycleBin.onRecycleBinChanged = function RecycleBinChanged()
{
    // Manage multiple events.
    setTimeout("RecycleBinChangedFeedback()",1000);
    bRecycleBinChangeHandled = false;
};

// --------------------------------------------------------------------
// Provide feedback on Recycle Bin content changes.
// --------------------------------------------------------------------
function RecycleBinChangedFeedback()
{
    if (bRecycleBinChangeHandled == false)
    {
        //
        // Display feedback to user.
        //
        
        // Manage multiple events.
        bRecycleBinChangeHandled = true;
    }
}

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008
IDL
Sidebar.idl
DLL
Sidebar.Exe (version 1.00 or later)