![]() ![]() ![]() ![]() _ Private Class NativeMethods _ Public Shared Function BeginUpdateResource(ByVal fileName As String, ByVal deleteExistingResources As Boolean) As IntPtr End Function _ Public Shared Function UpdateResource(ByVal hUpdate As IntPtr, ByVal type As IntPtr, ByVal name As IntPtr, ByVal language As Short, ByVal data() As Byte, ByVal dataSize As Integer) As Boolean End Function _ Public Shared Function EndUpdateResource(ByVal hUpdate As IntPtr, ByVal discard As Boolean) As Boolean End Function End Class ' The first structure in an ICO file lets us know how many images are in the file. So you have to translate between the two - you can't just load the ICO file as ' bytes and send them with the UpdateResource api call. ' The main problem is that ICO files store the icons in one set of structures, and exe/dll files store them in ' another set of structures. ' When you make the call you say "I'm updating an icon", and you send the icon data. Imports System.Security''' ''' This class is used to change the default icon of an executable.''' ''' ''' You can not change the icon from the same file this class executes from.''' Public Class IconInjector ' Basically, you can change icons with the UpdateResource api call. The following (although it works) is for information only, kind of gives you an idea behind the covers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |