[PTRun][System] Recycle Bin command: Allow opening RB + Improvements (#23045)

This commit is contained in:
Heiko
2023-01-10 15:09:23 +01:00
committed by GitHub
parent 25e9241d42
commit 196db19be8
12 changed files with 253 additions and 51 deletions

View File

@@ -202,6 +202,13 @@ namespace Wox.Plugin.Common.Win32
/// One or more arguments are not valid.
/// </summary>
E_INVALIDARG = 0x80070057,
/// <summary>
/// The operation was canceled by the user. (Error source 7 means Win32.)
/// </summary>
/// <SeeAlso href="https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-"/>
/// <SeeAlso href="https://en.wikipedia.org/wiki/HRESULT"/>
E_CANCELLED = 0x800704C7,
}
/// <remarks>

View File

@@ -44,5 +44,15 @@ namespace Wox.Plugin.Common.Win32
return NativeMethods.CloseHandle(handle);
}
/// <summary>
/// Gets the description for an HRESULT error code.
/// </summary>
/// <param name="hr">The HRESULT number</param>
/// <returns>A string containing the description.</returns>
public static string MessageFromHResult(int hr)
{
return Marshal.GetExceptionForHR(hr).Message;
}
}
}