Removed icon file extraction
This commit is contained in:
@@ -579,22 +579,17 @@ Public Class frmMain
|
|||||||
|
|
||||||
Private Sub SetGameIcon()
|
Private Sub SetGameIcon()
|
||||||
Dim ic As Icon
|
Dim ic As Icon
|
||||||
Dim sIconFile As String
|
|
||||||
Dim oBitmap As Bitmap
|
Dim oBitmap As Bitmap
|
||||||
|
|
||||||
Try
|
Try
|
||||||
'Grab icon from the executable
|
'Grab icon from the executable
|
||||||
ic = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName)
|
ic = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName)
|
||||||
|
oBitmap = New Bitmap(ic.ToBitmap)
|
||||||
'Save a copy
|
|
||||||
sIconFile = mgrPath.SettingsRoot & Path.DirectorySeparatorChar & oProcess.GameInfo.ID & ".ico"
|
|
||||||
ic.ToBitmap.Save(sIconFile, System.Drawing.Imaging.ImageFormat.Icon)
|
|
||||||
ic.Dispose()
|
ic.Dispose()
|
||||||
|
|
||||||
'Set the icon, we need to use an intermediary object to prevent file locking
|
'Set the icon, we need to use an intermediary object to prevent file locking
|
||||||
oBitmap = New Bitmap(sIconFile)
|
pbIcon.Image = oBitmap
|
||||||
pbIcon.Image = New Bitmap(oBitmap)
|
|
||||||
oBitmap.Dispose()
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
UpdateLog(mgrCommon.FormatString(frmMain_ErrorGameIcon), False, ToolTipIcon.Error)
|
UpdateLog(mgrCommon.FormatString(frmMain_ErrorGameIcon), False, ToolTipIcon.Error)
|
||||||
UpdateLog(mgrCommon.FormatString(App_GenericError, ex.Message), False,, False)
|
UpdateLog(mgrCommon.FormatString(App_GenericError, ex.Message), False,, False)
|
||||||
|
|||||||
Reference in New Issue
Block a user