mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 10:47:02 -07:00
Improved differentiating office icons, the actual application has a different icon as the "document". For Outlook this is even different for the email & meeting.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1666 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
9bf9c0b8d3
commit
be0569bb21
8 changed files with 117 additions and 47 deletions
|
@ -51,19 +51,21 @@ namespace GreenshotPlugin.Core {
|
|||
/// <summary>
|
||||
/// Internaly used to create an icon
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
public static Bitmap GetExeIcon(string path) {
|
||||
/// <param name="path">path to the exe or dll</param>
|
||||
/// <param name="index">index of the icon</param>
|
||||
/// <returns>Bitmap with the icon or null if something happended</returns>
|
||||
public static Bitmap GetExeIcon(string path, int index) {
|
||||
if (!File.Exists(path)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
using (Icon appIcon = Icon.ExtractAssociatedIcon(path)) {
|
||||
using (Icon appIcon = ImageHelper.ExtractAssociatedIcon(path, index, false)) {
|
||||
if (appIcon != null) {
|
||||
return appIcon.ToBitmap();
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
} catch (Exception exIcon) {
|
||||
LOG.Error("error retrieving icon: ", exIcon);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue