i have a big problem here
when try to change exe icon it change successful but when try to run exe
error message : (.exe is not a valid win32 application) ??
where is the problem in code ??
Code: Select all
function UpdateExeIcon(exeFile, iconGroup, icoFile: string) : boolean;
var resUpdateHandle : dword;
begin
resUpdateHandle := BeginUpdateResourceW(PWideChar(wideString(exeFile)), false);
if resUpdateHandle <> 0 then begin
result := LoadIconGroupResourceW(resUpdateHandle, PWideChar(wideString(iconGroup)), 0, PWideChar(wideString(icoFile)));
result := EndUpdateResourceW(resUpdateHandle, false) and result;
end else
result := false;
end;
UpdateExeIcon('c:\1.exe', 'MAINICON', 'c:\111.ico');