Deleting XPMan resource.

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

Deleting XPMan resource.

Postby firer » Sat Dec 06, 2008 11:08 am

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
firer
 
Posts: 1
Joined: Sat Dec 06, 2008 11:02 am

Return to madBasic

Who is online

Users browsing this forum: No registered users and 1 guest

cron