NO

Author Topic: Error repaint .ICO  (Read 3761 times)

alderman

  • Guest
Error repaint .ICO
« on: February 18, 2019, 12:12:51 AM »
On Google-eng:
........................

I get a strange error.
When I redraw a .ico to a program, .ico is changed as I drew it. But to the .exe file, the old one still remains. When I start .exe I see the new one in the window that opens.

I did some tests and redesigned some .ico files. When I finish, I put them in the same .exe as above. The first .ico is left !!!

Can't change to another .ICO file once you have used a .ICO file?



On Swe:
....................

Jag får ett märkligt fel.
När jag ritar om en .ico till ett program blir .ico ändrad som jag ritat den. Men till .exe-filen sitter den gamla kvar fortfarande. När jag startar .exe ser jag den nya i fönstret som öppnas.

Jag gjorde några tester och ritade om några .ico-filer. När jag är klar lägger jag in dem i samma .exe som ovan. Den första .ico är kvar!!!

Går det inte ändra till annan .ICO-fil när man en gång använt en .ICO-fil?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Error repaint .ICO
« Reply #1 on: February 18, 2019, 08:59:50 AM »
The problem might be a windows icon cache.
Try to refresh icons with this example:
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
//#include <shlobj.h> // slow
#pragma comment(lib, "shell32.lib")
#define SHCNE_ASSOCCHANGED  0x08000000L
#define SHCNF_IDLIST  0x0000
__declspec(dllimport) void WINAPI SHChangeNotify(LONG, UINT, LPCVOID, LPCVOID);
void __cdecl WinMainCRTStartup(void)
{
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
ExitProcess(0);
}
Quote
Applications that register new handlers of any type must call SHChangeNotify with the SHCNE_ASSOCCHANGED flag to instruct the Shell to invalidate the icon and thumbnail cache. This will also load new icon and thumbnail handlers that have been registered. Note, however, that icon overlay handlers are not reloaded.
May the source be with you