In this tutorial I will show you how to open any file, extract the icon and save it!
First of all, Let's start with the GUI. We'll need the following:
-Menu Strip (Two button, Open and Save)
-Picturebox
Quite a basic GUI but you can add on to it with whatever you like!
On our Menustrip, double click the "Open" button to get automatically generated sub methods of the button when clicked.
Inside this Sub we will put our code to open an OpenFileDialogue and then use that dialogue to open the program!
Spoiler to see the whole code:
Spoiler (Click to View)
Once you have the OpenFileDialogue set we will make sure the Icon can be loaded into the Picturebox. So we will use a function I wrote to get the Icon and set it as an Image in the Picturebox.
Once again, A spoiler so it doesn't get ruined early:
Spoiler (Click to View)
We're almost there!!
Ok, Now to save the icon! This is almost the same as the OpenFileDialogue - If you've guess it, we're going to use a SaveFileDialogue for this one.
Try this step before you open the spoiler, It might intrigue you.
Spoiler (Click to View)
That's it! You've now made your own File Extracting program! Congradulations!
Here's the source if something has gone wrong. Download it here. (VB.NET 2010)