WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

IconReplace and IntControl (37...) Functions Don't Appear to be Working

Keywords:  IconReplace icons    IntControl(37, Intcontrol (37,

Icons and the Compiler

Question:

I tried to use an icon file from the MS NT4 resource kit "themes" collection in a compiled file, but the icon was rejected as being the wrong 'format' or 'size'.

I then checked and found that the icon size was over 10K whereas the standard icons with Winbatch are 766 bytes.

Is the compiler only able to work with icon files that are 766 bytes long ?

Answer:

Yes, Compiler can only use icon files that are 766 bytes and which are in the standard icon format. Also, Compiler cannot place a 32-bit Icon on a 16-bit application.

IconReplace and IntControl 37

Question:

I'm using the IconReplace function and think I've followed all the rules above. When I run my script with the IconReplace function in it, it seems to work OK (and returns a 1 in debug mode), but the icon isn't getting changed when I look at it in Explorer. The icon changes fine when I change it via the Compiler option to do so, but I want to be able to do this programmatically.

Answer:

If the icon fits the criteria above, it's likely that the new icon is getting stuffed into the EXE, but is just not getting displayed in Explorer. Run the EXE. Do you notice the new icon showing up in the task bar? Create a shortcut to the EXE in Explorer, and look at the shortcut properties. Do you now see the list of icons in the file, including the new one that you assigned to it?

If you see the icon, but it's just not showing up in Explorer, edit the Shortcut to the EXE, and into the Change Icon control. In what position is the icon that actually displays in Explorer showing up in the list?

Once you know that, then you can use the IntControl(37,p1, p2, p3, 0) function to replace the icon in that position in your EXE. (Ex.: 1=first icon) In our experience, it's usually the #2 icon that shows up in the taskbar, so by default, these functions replace the icon in that position. You'll need to specify a different position if you want something other than the second.


Article ID:   W13081
Filename:   IconReplace - IntControl 37 - Not Working.txt
File Created: 1999:09:21:17:05:38
Last Updated: 1999:09:21:17:05:38