Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Files.Launcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ private static async Task parseRecycleBinAction(AppServiceRequestReceivedEventAr

case "Query":
var responseQuery = new ValueSet();
Shell32.SHQUERYRBINFO queryBinInfo = new Shell32.SHQUERYRBINFO();
queryBinInfo.cbSize = (uint)Marshal.SizeOf(queryBinInfo);
var res = Shell32.SHQueryRecycleBin("", ref queryBinInfo);
Win32API.SHQUERYRBINFO queryBinInfo = new Win32API.SHQUERYRBINFO();
queryBinInfo.cbSize = Marshal.SizeOf(queryBinInfo);
var res = Win32API.SHQueryRecycleBin("", ref queryBinInfo);
if (res == HRESULT.S_OK)
{
var numItems = queryBinInfo.i64NumItems;
Expand Down
21 changes: 17 additions & 4 deletions Files.Launcher/Win32API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,22 @@ public static (string icon, bool isCustom) GetFileOverlayIcon(string path)
byte[] bitmapData = (byte[])new ImageConverter().ConvertTo(image, typeof(byte[]));
return (Convert.ToBase64String(bitmapData, 0, bitmapData.Length), isCustom);
}
}

// There is usually no need to define Win32 COM interfaces/P-Invoke methods here.
// The Vanara library contains the definitions for all members of Shell32.dll, User32.dll and more
// The ones below are due to bugs in the current version of the library and can be removed once fixed
// There is usually no need to define Win32 COM interfaces/P-Invoke methods here.
// The Vanara library contains the definitions for all members of Shell32.dll, User32.dll and more
// The ones below are due to bugs in the current version of the library and can be removed once fixed
// Structure used by SHQueryRecycleBin.
[StructLayout(LayoutKind.Sequential, Pack = 0)]
public struct SHQUERYRBINFO
{
public int cbSize;
public long i64Size;
public long i64NumItems;
}

// Get information from recycle bin.
[DllImport(Lib.Shell32, SetLastError = false, CharSet = CharSet.Auto)]
public static extern int SHQueryRecycleBin(string pszRootPath,
ref SHQUERYRBINFO pSHQueryRBInfo);
}
}
4 changes: 0 additions & 4 deletions Files.Launcher/Win32API_ContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,4 @@ public void Dispose()
}
}
}

// There is usually no need to define Win32 COM interfaces/P-Invoke methods here.
// The Vanara library contains the definitions for all members of Shell32.dll, User32.dll and more
// The ones below are due to bugs in the current version of the library and can be removed once fixed
}