From 692deaaef9173440825fdcc1492541a08266577c Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Wed, 25 Jul 2018 09:21:50 -0600 Subject: [PATCH] Changes for issue #142 --- GBM/Forms/frmMain.vb | 11 ++++++++--- GBM/My Project/AssemblyInfo.vb | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index c7445ef..db0678b 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -581,6 +581,8 @@ Public Class frmMain Dim sFileName As String = String.Empty Dim sFileVersion As String = String.Empty Dim sCompanyName As String = String.Empty + Dim ic As Icon + Dim sIconFile As String 'Wipe Game Info lblStatus1.Text = String.Empty @@ -589,14 +591,17 @@ Public Class frmMain 'Get Process Information Try - Dim ic As Icon = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName) - pbIcon.Image = ic.ToBitmap + 'Grab icon from the executable and save a copy + ic = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName) + sIconFile = mgrPath.SettingsRoot & Path.DirectorySeparatorChar & oProcess.GameInfo.ID & ".bmp" + ic.ToBitmap.Save(sIconFile) + ic.Dispose() 'Set Game Details + pbIcon.Image = Image.FromFile(sIconFile) sFileName = oProcess.FoundProcess.MainModule.FileName sFileVersion = oProcess.FoundProcess.MainModule.FileVersionInfo.FileVersion sCompanyName = oProcess.FoundProcess.MainModule.FileVersionInfo.CompanyName - Catch ex As Exception pbIcon.Image = Icon_Unknown End Try diff --git a/GBM/My Project/AssemblyInfo.vb b/GBM/My Project/AssemblyInfo.vb index ddd04d2..7de97fc 100644 --- a/GBM/My Project/AssemblyInfo.vb +++ b/GBM/My Project/AssemblyInfo.vb @@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + \ No newline at end of file