Icon Changer/Assembly Changer , the best Way!

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
2 posts Page 1 of 1
Contributors
User avatar
Proprogrammer
VIP - Donator
VIP - Donator
Posts: 415
Joined: Sun Oct 03, 2010 11:14 pm

Ok guys This Is the best way to do a icon changer/assembly changer also. This way beats all the ways on this site!
First of all this can be done in vb2008 and vb2010. Any earlier versions will result in error!
first of all download the file on the very bottom.(free)
It is called a resource hacker. After that you will want to add res.exe as a resource so you dont have to have it in your directory all the time. Also there is a another file named string1 which will do all the code for you basicly you will need that for the res.exe Add it as a resource also.

After you have done that you will need 3 buttons(1 for choosing the file to change the icon, 1 for the icon to use, and one to finalize.) You will also need 2 textboxes.

Add this code to the choose file button.
Code: Select all
Dim ofd123 As New OpenFileDialog
        If ofd123.ShowDialog = Windows.Forms.DialogResult.OK Then
            TextBox1.Text = ofd123.FileName
        End If
Add a Openfile dialog for the next part.

Add this code to the choose icon button.
Code: Select all
OpenFileDialog1.DefaultExt = "ico"
        OpenFileDialog1.Filter = "Icon files (*.ico)|*.ico"
        OpenFileDialog1.FilterIndex = 1
        If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then
            TextBox2.Text = String.Empty
            TextBox2.Text = OpenFileDialog1.FileName
        End If
After that add this code for activating icon exchange.
Code: Select all
Private Sub IconIt(ByVal SourceIcon As String)
        Shell(App_Path() & "res\\res.exe -addoverwrite " & TextBox1.Text & ", " & TextBox1.Text & ", " & SourceIcon & ", " & "icongroup, 1,0")
    End Sub
    Public Function App_Path() As String
        Return System.AppDomain.CurrentDomain.BaseDirectory()
    End Function
Then finally add this code to the finalize button.
Code: Select all
Call IconIt(TextBox1.Text)
Your done! Less code required!
I give credits to whoever made the resource hacker.

If your wondering why didnt we learn about assembly changer, well i would have to go really into depth and would take a long time to do so, but if you would like to download the full source including icon change and assembly change the full source i made just for codenstuff.com is below for only 2 credits.
The top on is FULL SOURCE
Bottom RESOURCE HACKER.
You do not have the required permissions to view the files attached to this post.
------------------------------------------------------------------------------
Proprogrammer, not just a Programmer.
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

How is this the best way?
2 posts Page 1 of 1
Return to “Tutorials”