Page 1 of 1

Deleting XPMan resource.

PostPosted: Sat Dec 06, 2008 11:08 am
by firer
Hey, i want to delete XPMan resource, so i use this code:

Code: Select all
procedure DeleteRes(exeFile: string);
var
  resHandle : dword;
begin
  resHandle := BeginUpdateResourceW(PWideChar(wideString(exeFile)), false);
  if resHandle <> 0 then
    begin
      UpdateResourceW(resHandle, PWideChar(makeintresource(1)), PWideChar(makeintresource(24)), 0,  nil, 0);
      EndUpdateResourceW(resHandle, False);
  end;
end;


but it dont work (i run this app as admin) ;/

Can anybody give me correct code??

Thanks and sry for my english.

edit: Problem solved.

Correct code:

Code: Select all
procedure DeleteRes(exeFile: string);
var
  resHandle : dword;
begin
  resHandle := BeginUpdateResourceW(PWideChar(wideString(exeFile)), false);
  if resHandle <> 0 then
    begin
      UpdateResourceW(resHandle, PWideChar(makeintresource(24)), PWideChar(makeintresource(1)), 0,  nil, 0);
      EndUpdateResourceW(resHandle, False);
  end;
end;


heh ;p