Hi Guys,
How can I embed Icons in a Exe file. If you see for example in Winamp there are a lot of Icons inside the EXE file. How can I embed Icons like that. Any Idea...
Printable View
Hi Guys,
How can I embed Icons in a Exe file. If you see for example in Winamp there are a lot of Icons inside the EXE file. How can I embed Icons like that. Any Idea...
You could put them into a resource file, and then if you make a shortcut to your exe and change the properties, you can select one of the icons that's inside the exe.
Hi Kaverin,
How do I create a Resource file. Can u Please Explain me. I'm a beginner to VB. So pl., give me a detailed description...:(
There is a resource editor add in. If you go to the Add-In menu and click on "Add-In Manager", the resource editor should appear as one of the options. Just check it and it will load. It should put a new button in your toolbar that has a green cube on it. You can press that button, or right click in the prooject explorer window and select "add resource file". Enter a file when it prompts you (if you select the add file way), and it will start up the editor. Then you can double click the file in the window to edit it. There are buttons along the top of the editor window for adding different types of resources, like cursors, icons, bitmaps, strings, or custom ones where you could add other files like music ones or data files.
Hi kaverin,
I got ur code and it's working nicely. But is it possible to access those icons or music files dynamically... I think you get it. If you see in winamp all these icons will be available at runtime. We can choose betn. these icons for display in Tray Icon, File association, etc., Is it possible... Anyway thnx for ur code....
Hi Kaverin,
I tried out ur code and it's working fine for known file types like icon, cursor or bitmap. If i try to load file of unknown type like HTML file or Sound file, I'm getting Problem. I embedded a HTML File and tried to open it with the Microsoft Internet Control. But I'm getting the error that the Page cannot be displayed. Where as if i put the same outside the resource editor it's working Properly. What may be the Problem...? I get the same error with windows Multimedia Control when I try to embed MIDI files in my Prog. I also have another doubt. I embedded a text file in my app. I know I'll be able to embed. Now how Do I open it and read it. Also I want to know how do I update it. For example I'm trying to using the text file as a .inf file to store info about my app and next time when my app starts i need to get the info from it. I feel that if the inf file is embedded in my app, it would be safe and i can avoid some validations. Hope you understand my Question. Expecting for ur help. Thanks in advance.
Anything that's not one of the predefined types like bitmap etc will be picked up by the editor as a custom one, which is why I have "SOUND" as the type for the sound file. What you call it doesn't matter, but people generally make a descriptive type for it. You just have to make sure that when you pull the file out later that you use the same type you added it in under. For any type that follows under custom like this, you get them out with LoadResData(), and it will return a byte array. So for MIDI files, I'd probably call them "MIDI" when putting them in, then pull them out with that and put them into a byte array. I don't know of a way to play MIDI files from memory like you can with wav files, so you'll have to extract the file into a byte array first, then write it to a temp file, then play that. I believe MCI may have the capability of playing some other audio files from a memory buffer but I'm not positive on that. If you have a text file you're trying to save/load prog info from, you'd probably be better off using the registry if you need security, or an INI file if not (they're easier to work with). You can't change the things inside a resource file from the prog that uses the data from the resource file in the first place, so if you save your text/HTML files in the resource file, you'll have to write them to the hard drive if you want to change them later.
Hi Kaverin,
I know how to use the Registry with the Savesetting, Getsetting. But it's very slow. Ok. Can u please tell me how should I load files of custom Type. Say for example How should I load a HTML file from a Resource Editor. Please tell with a example. Thnx for ur advice.