-2
如何加載資源形成另一個文件?
這是從項目加載資源腳本:從文件加載資源
function Loadhwid: string;
var
ResourceLocation: HRSRC;
ResourceSize: dword;
ResourceHandle: THandle;
ResourcePointer: pointer;
begin
ResourceLocation := FindResource(hInstance, 'HWID', RT_RCDATA);
ResourceSize := SizeofResource(hInstance, ResourceLocation);
ResourceHandle := LoadResource(hInstance, ResourceLocation);
ResourcePointer := LockResource(ResourceHandle);
if ResourcePointer <> nil then
begin
SetLength(Result, ResourceSize - 1);
CopyMemory(@Result[1], ResourcePointer, ResourceSize);
FreeResource(ResourceHandle);
end;
end;
但我想知道如何從外部exe文件(我知道怎麼寫的資源)加載資源。
我想用這個腳本作爲HWID的更新工具。
你還需要幫助嗎? –