![]() |
|
need some help with icon injection... - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: need some help with icon injection... (/Thread-need-some-help-with-icon-injection) |
need some help with icon injection... - 1234hotmaster - 02-03-2011 well, in my program it will download a .ico file from a source then save it to the temp path. next i used sage's iconinjector class which i did: Iconinjector.inject(application.executablepath, environ("temp") & "/1.ico" but every time i tried it wont inject itself but will inject other executable's. is there any solution? RE: need some help with icon injection... - Coder-san - 02-03-2011 You cannot edit any file which is running. Just make a copy of the executable, and change its icon. RE: need some help with icon injection... - 1234hotmaster - 02-03-2011 well... the real code is: if my.computer.info.osfullname.contains("Windows XP") = true then iconinjector.inject(application.executablepath, environ("temp") & "\1.ico") else iconinjector.inject(application.executablepath, environ("temp") & "\2.ico") end if well, sorry im a bit dumb but if you copy the file and inject it i want it renamed the same as the file and in the same directory also don't want 2 processes... what to do? :rip: RE: need some help with icon injection... - Coder-san - 02-03-2011 So you want to save the icon or change some exe's icon? Oo RE: need some help with icon injection... - 1234hotmaster - 02-03-2011 in the end i want the file to run the code normally but have its icon changed depending on the OS
RE: need some help with icon injection... - Coder-san - 02-03-2011 You can only change the small icon in the Form at runtime, otherwise copy the program, change icon and start it instead of original app. Code: IO.File.Copy(Application.ExecutablePath, CurDir() & "\" & ProductName & "2.exe")
Dim iconPath As String = String.Empty
if my.computer.info.osfullname.contains("Windows XP") = true then
iconPath = environ("temp") & "\1.ico"
else
iconPath = environ("temp") & "\2.ico"
end if
iconinjector.inject(CurDir() & "\" & ProductName & "2.exe", iconPath)
Process.Start(CurDir() & "\" & ProductName & "2.exe")
Me.Close()This is pretty much noticeable though. RE: need some help with icon injection... - 1234hotmaster - 02-03-2011 tnx man for taking your time it works :Thumbs: |