exe is not a valid win32 application ...........!!!

delphi package - madRes, madTools, madStrings, ...

exe is not a valid win32 application ...........!!!

Postby yes_me » Sun Oct 08, 2006 8:22 am

Madshi,

i have a big problem here :cry:

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');


thank you and sorry for my bad english..........
yes_me
 
Posts: 1
Joined: Sun Oct 08, 2006 8:11 am

Postby madshi » Sun Oct 08, 2006 9:21 am

Is the exe UPX compressed? Updating resources in compressed exes doesn't work properly.
madshi
Site Admin
 
Posts: 9431
Joined: Sun Mar 21, 2004 5:25 pm


Return to madBasic

Who is online

Users browsing this forum: No registered users and 1 guest

cron