mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
fix #1456 Error when empty recycle bin
This commit is contained in:
@@ -143,9 +143,10 @@ namespace Wox.Plugin.Sys
|
||||
Action = c =>
|
||||
{
|
||||
// http://www.pinvoke.net/default.aspx/shell32/SHEmptyRecycleBin.html
|
||||
// FYI, couldn't find documentation for this but if the recycle bin is already empty, it will return -2147418113 (0x8000FFFF (E_UNEXPECTED))
|
||||
// 0 for nothing
|
||||
var result = SHEmptyRecycleBin(new WindowInteropHelper(Application.Current.MainWindow).Handle, 0);
|
||||
if (result != (uint) HRESULT.S_OK)
|
||||
if (result != (uint) HRESULT.S_OK && result != (uint)0x8000FFFF)
|
||||
{
|
||||
MessageBox.Show($"Error emptying recycle bin, error code: {result}\n" +
|
||||
"please refer to https://msdn.microsoft.com/en-us/library/windows/desktop/aa378137",
|
||||
|
||||
Reference in New Issue
Block a user