![]() file up and do several resource updates. resource, indeed one resource for each image, so we have to split the icon Windows considers that (a) and (b) are one resource but (c) is a different But that's how icons are stored as files. the file (b) sixteen bytes of metadata for each icon (c) the icons. includes among other things information about how many icons are in An icon file consists of (a) a six-byte header which procedure TForm1.Button1Click(Sender: TObject) Doing it the other way it seems like it doesn't. Doing it this way Windows has built in facilities for me to do this. (Download Resource Hacker for an example.) But you can't just do this by reversing my code as it were, there are obstacles in your way. ico file from an executable file, then this is of course theoretically possible and has been done by cleverer people then me and indeed done in Pascal. (5) If you're wondering about how to do the thing the other way round and extract an. If you're going to use this in any language in other than Pascal but you're still using Windows, then it will translate kind of easily because it's basically telling the Windows OS to do stuff, but you'll have to find out which library or whatever lets you do that and what syntax it wants you to use. (4) If you're going to use this in Pascal, then you're going to need to add Windows to your uses statement. (3) This is NOT an answer to that frequently-asked question, "How do I change the toolbar icon of my Pascal-based application while it's running?" Because you can't do a resource update on an executable that's being executed, whether your own or another. This is fine for my purposes, if it's a problem for you then again you'll have to solve it yourself, sorry. (2) File Explorer caches this stuff so hard that you won't see any change in how the icon's displayed there unless you restart Explorer. If it isn't what you want you'll have to take it from here. 99% of the time this would be exactly what you want. (1) Although the application icon (in the top left corner of your main form) can be set to be completely different from the main icon for the program, it seems like it's overwritten to be in line with the main icon once you do the update. How the thing works is explained in the code but what exact effect it has on Windows must be explained up here. I was like someone trying to fit a seven-fingered hand into one finger of a five-fingered glove. ico file and split it into different pieces and do a resource update separately on each. In this particular case I needed to modify the structure of the. exe file using a resource update you must be sure it will fit. Before you try to put any bit of data into an. Raise Exception.Create('System giving error message: ' VResHandle := BeginUpdateResource('exec.exe', False) Set the position in the memory stream to the start. ![]() ![]() Also that they all have an ordinal name of 150 if that means anything to anyone. It is now even closer, if I look at the updated version in Resource Hacker it tells me that the group has nine icons, which is true, that they're 16.8 million color, which is true, that they're all 16 x 16, which is not true, and that it can't actually show me what they look like, which is annoying. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |