-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation
Koray Üstündağ edited this page May 16, 2023
·
2 revisions
The ShellIconExtractor class provides a convenient way to extract icons from the Shell32.dll file.
Creates a new instance of the ShellIconExtractor class with the specified file path and icon index.
-
filePath: The path of the file from which to extract the icon. -
iconIndex: The index of the icon to extract from the file.
Gets the extracted icon with the specified size.
-
size: The size of the icon to retrieve.
// Create a new instance of ShellIconExtractor
var iconExtractor = new ShellIconExtractor("C:\\path\\to\\file.txt", 0);
try
{
// Get the icon with size 32x32
var icon = iconExtractor.GetIcon(32);
// Use the icon as needed
// ...
}
catch (Exception ex)
{
Console.WriteLine("An error occurred: " + ex.Message);
}
finally
{
// Dispose of the ShellIconExtractor instance
iconExtractor.Dispose();
}The ShellIconExtractor class can throw the following exceptions:
-
ArgumentException: Thrown if the arguments provided to the constructor are invalid. -
InvalidOperationException: Thrown if the icon handle is invalid. -
OutOfMemoryException: Thrown if there is not enough memory to create the icon. -
Win32Exception: Thrown if an error occurs in the Win32 API calls. -
ExternalException: Thrown if an external exception occurs. -
NotSupportedException: Thrown if the operation is not supported. -
Exception: Thrown for any other unhandled exception.
For more information, refer to the API Reference documentation.
This project is maintained by Koray Üstündağ.
If you have any questions or need support, feel free to reach out to us at mskorayustundag@gmail.com.
This project is licensed under the MIT License. See the LICENSE file for details.