File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -492,9 +492,9 @@ private static async Task parseRecycleBinAction(AppServiceRequestReceivedEventAr
492
492
493
493
case "Query" :
494
494
var responseQuery = new ValueSet ( ) ;
495
- Shell32 . SHQUERYRBINFO queryBinInfo = new Shell32 . SHQUERYRBINFO ( ) ;
496
- queryBinInfo . cbSize = ( uint ) Marshal . SizeOf ( queryBinInfo ) ;
497
- var res = Shell32 . SHQueryRecycleBin ( "" , ref queryBinInfo ) ;
495
+ Win32API . SHQUERYRBINFO queryBinInfo = new Win32API . SHQUERYRBINFO ( ) ;
496
+ queryBinInfo . cbSize = Marshal . SizeOf ( queryBinInfo ) ;
497
+ var res = Win32API . SHQueryRecycleBin ( "" , ref queryBinInfo ) ;
498
498
if ( res == HRESULT . S_OK )
499
499
{
500
500
var numItems = queryBinInfo . i64NumItems ;
Original file line number Diff line number Diff line change @@ -133,9 +133,22 @@ public static (string icon, bool isCustom) GetFileOverlayIcon(string path)
133
133
byte [ ] bitmapData = ( byte [ ] ) new ImageConverter ( ) . ConvertTo ( image , typeof ( byte [ ] ) ) ;
134
134
return ( Convert . ToBase64String ( bitmapData , 0 , bitmapData . Length ) , isCustom ) ;
135
135
}
136
- }
137
136
138
- // There is usually no need to define Win32 COM interfaces/P-Invoke methods here.
139
- // The Vanara library contains the definitions for all members of Shell32.dll, User32.dll and more
140
- // The ones below are due to bugs in the current version of the library and can be removed once fixed
137
+ // There is usually no need to define Win32 COM interfaces/P-Invoke methods here.
138
+ // The Vanara library contains the definitions for all members of Shell32.dll, User32.dll and more
139
+ // The ones below are due to bugs in the current version of the library and can be removed once fixed
140
+ // Structure used by SHQueryRecycleBin.
141
+ [ StructLayout ( LayoutKind . Sequential , Pack = 0 ) ]
142
+ public struct SHQUERYRBINFO
143
+ {
144
+ public int cbSize ;
145
+ public long i64Size ;
146
+ public long i64NumItems ;
147
+ }
148
+
149
+ // Get information from recycle bin.
150
+ [ DllImport ( Lib . Shell32 , SetLastError = false , CharSet = CharSet . Auto ) ]
151
+ public static extern int SHQueryRecycleBin ( string pszRootPath ,
152
+ ref SHQUERYRBINFO pSHQueryRBInfo ) ;
153
+ }
141
154
}
Original file line number Diff line number Diff line change @@ -455,8 +455,4 @@ public void Dispose()
455
455
}
456
456
}
457
457
}
458
-
459
- // There is usually no need to define Win32 COM interfaces/P-Invoke methods here.
460
- // The Vanara library contains the definitions for all members of Shell32.dll, User32.dll and more
461
- // The ones below are due to bugs in the current version of the library and can be removed once fixed
462
458
}
You can’t perform that action at this time.
0 commit comments