You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Obtains a BitmapSource thumbnail for the specified file.
43
+
/// </summary>
44
+
/// <remarks>
45
+
/// If the file is a Windows URL shortcut (".url"), the method attempts to resolve the shortcut's icon and use that for the thumbnail; otherwise it requests a thumbnail for the file path. The native HBITMAP used to create the BitmapSource is always released to avoid native memory leaks.
46
+
/// </remarks>
47
+
/// <param name="fileName">Path to the file (can be a regular file or a ".url" shortcut).</param>
48
+
/// <param name="width">Requested thumbnail width in pixels.</param>
49
+
/// <param name="height">Requested thumbnail height in pixels.</param>
@@ -50,6 +74,21 @@ public static BitmapSource GetThumbnail(string fileName, int width, int height,
50
74
}
51
75
}
52
76
77
+
/// <summary>
78
+
/// Obtains a native HBITMAP for the specified file at the requested size using the Windows Shell image factory.
79
+
/// </summary>
80
+
/// <remarks>
81
+
/// If <paramref name="options"/> is <see cref="ThumbnailOptions.ThumbnailOnly"/> and thumbnail extraction fails
82
+
/// due to extraction errors or a missing path, the method falls back to requesting an icon (<see cref="ThumbnailOptions.IconOnly"/>).
83
+
/// The returned HBITMAP is a raw GDI handle; the caller is responsible for releasing it (e.g., via DeleteObject) to avoid native memory leaks.
84
+
/// </remarks>
85
+
/// <param name="fileName">Path to the file to thumbnail.</param>
86
+
/// <param name="width">Requested thumbnail width in pixels.</param>
87
+
/// <param name="height">Requested thumbnail height in pixels.</param>
88
+
/// <param name="options">Thumbnail request flags that control behavior (e.g., ThumbnailOnly, IconOnly).</param>
89
+
/// <returns>An HBITMAP handle containing the image. Caller must free the handle when finished.</returns>
90
+
/// <exception cref="COMException">If creating the shell item fails (HRESULT returned by SHCreateItemFromParsingName).</exception>
91
+
/// <exception cref="InvalidOperationException">If the shell item does not expose IShellItemImageFactory or if an unexpected error occurs while obtaining the image.</exception>
<system:Stringx:Key="folderOpenError">An error occurred while opening the folder. {0}</system:String>
592
592
<system:Stringx:Key="browserOpenError">An error occurred while opening the URL in the browser. Please check your Default Web Browser configuration in the General section of the settings window</system:String>
593
+
<system:Stringx:Key="fileNotFoundError">File or directory not found: {0}</system:String>
0 commit comments