Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 737333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:42:33+00:00 2026-05-14T07:42:33+00:00

We have a Windows desktop application written in Delphi that works fine on Windows

  • 0

We have a Windows desktop application written in Delphi that works fine on Windows 7, except that the icon of the main form looks blurry in Windows’ new taskbar. As long as the application has not been started the icon looks fine (i.e. when it’s pinned to the taskbar). Once it has been started Windows uses the icon of the main form (instead of the .exe resource icon) and it’s blurry (it looks like a 16×16 version of the icon is scaled up).

The icon that we use for the .exe and for the main form are exactly the same and it contains all kinds of resolutions, including 48×48 with alpha blending.

My theory is that Delphi ignores/deletes the extra resolutions of the icon when I import the .ico file for the main form in Delphi. Is there a way to prevent/fix this? What’s the best way to ensure that an application written in Delphi uses the correct icon resolution in Windows 7’s taskbar?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:42:33+00:00Added an answer on May 14, 2026 at 7:42 am

    The problem lies within lazy programming within the VCL not fitting with the behavioral change of the OS. More or less it is like this;

    TCustomForm.CreateWnd, after the window handle is created, calls;

      SendMessage(Handle, WM_SETICON, 1, LPARAM(GetIconHandle)) else
    

    Notice the “1” in place of wParam, that’s ICON_BIG. Actually the VCL sets the large icon of the form. But the icon’s requested size (TIcon.FRequestedSize) is 16×16 (by default), and so the TIcon of the form returns a handle for the small icon. That’s the size for the system small icon and is determined in the constructor CreateNew with calls to GetSystemMetrics.

    Since earlier versions of Windows used the small icon on the taskbar this was no problem. Hovewer the Alt+Tab dialog had the problem other way around; if an icon was assigned to a form it showed “blurred” in the Alt+Tab dialog. Anyway, Windows 7, still, by default returns 16×16 for the small icon (SM_CXSMICON/SM_CYSMICON) and 32×32 for the large icon (SM_CXICON/SM_CYICON), but the large taskbar displays the large icon, if there is one that is..

    The correct approach would be to assign a large image (if there is one in the icon) for the large icon and assign a small image (if there is one) to the small icon. Granted, since the sizes would not have to have exact matches, this would require a complex algorithm. Instead, a simpler but broken design is implemented.

    For a workaround, I don’t assign an icon to the forms in the OI and instead use this;

    procedure SetFormIcons(FormHandle: HWND; SmallIconName, LargeIconName: string);
    var
      hIconS, hIconL: Integer;
    begin
      hIconS := LoadIcon(hInstance, PChar(SmallIconName));
      if hIconS > 0 then begin
        hIconS := SendMessage(FormHandle, WM_SETICON, ICON_SMALL, hIconS);
        if hIconS > 0 then
          DestroyIcon(hIconS);
      end;
      hIconL := LoadIcon(hInstance, PChar(LargeIconName));
      if hIconL > 0 then begin
        hIconL := SendMessage(FormHandle, WM_SETICON, ICON_BIG, hIconL);
        if hIconL > 0 then
          DestroyIcon(hIconL);
      end;
    end;
    

    and include an “icons.res” with named icons having 16×16 and 32×32 images, in the project. All the forms in their OnCreate call

     SetFormIcons(Handle, 'MYFORM', 'MYFORM');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I also have a desktop application written in Windows Forms that is a middling
I've written a Windows desktop application that works with Sqlite very nicely. It was
We have a mature Windows desktop application written in C++. The application's GUI sits
I have a Windows.Forms based .NET desktop application that stores privileged information in a
We have an existing windows desktop app written in C# 6 that uses an
I have a desktop application written in Ruby that is using GTK2. It's just
I am in a Windows Desktop application and I have a data stream and
I'm looking to have windows recognize that certain folders are associated to my application
I have a C++ desktop application (written in wxWidgets) and I want to add
I have an IFilter written in Delphi that I'm trying to get working under

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.