Why does the icon for my project look so awful in Windows 7?

I have an old VB6 project that I updated for Windows 7, including 48x48 icons. When I launched it, the icon on the taskbar is washed out.

enter image description here

I think I have all the required icon sizes in the .ico file, but maybe something is missing for me:

enter image description here

What am I missing here?

+4
source share
3 answers

VB6 only supports 16 color icons, which will result in smoothing and, therefore, transparency information is limited to one bit, indicating whether the pixel is transparent or not.

As always, you can rely on a set of Windows APIs to overcome this limitation. Here's a link to a forum post explaining how to use 256 color icons: System tray icon VB6 Color depth

+4
source

I found a vbaccelerator article from XP working days, which seems to work on Windows 7. The key should follow the instructions for the letter. And it only works in a compiled application, not in an IDE. Finally, when you add a 256x256 image to your icon, make sure it is not PNG compressed when the icon is saved (most editors prefer something hidden somewhere).

+3
source

The solution is very simple: Enable visual styles; Add the manifest to your application and VB environment.

Adding a manifest to the VB IDE is a bit more complicated in Vista and above. Follow the instructions here: http://vbnet.mvps.org/index.html?code/forms/vbidevista.htm

Then to add a manifest to your application. It will also allow you to run the application as elevated (have administrator access at startup): Step 1. Create a manifest text file. There are two options: a regular manifest file and a manifest file that requires administrator rights.

Manifest File: (Download link at end)

Administrator manifest file: (Download link at end)

After creating the manifest file, add it to your project:

Open the resource editor and click "Add a custom resource ..." (the button next to the question mark). Select the manifest file and add it to the editor. Now double-click on the added resource to change its properties. Set the following values:

Type: # 24

ID: 1

Now, here is the last and most important step:

Set up the project to work with Sub Main. In Sub Main, as one of the first things, you call the InitCommonControls function. This must be called before any forms, controls or other dialogs are loaded.

InitCommonControls: (Download link at the end)

What is it! Your VB6 is not fully updated and uses visual styles.

Download link, as promised: https://www.dropbox.com/sh/neyueoozv87k1qd/AACbID8_aC718LCjs12T16Oqa?dl=0

0
source

All Articles