Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi UpdateResource (https://www.delphipraxis.net/105429-updateresource.html)

McPri 21. Dez 2007 15:58


UpdateResource
 
Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
var
  res: HWND;
  s: WideString;
  sv: string;
begin

res := BeginUpdateResource('C:\\Datei.exe', false);
s  := WideString('Irgendwas.');

if(UpdateResource(res, RT_STRING, MAKEINTRESOURCE(10), MAKEWORD(LANG_NEUTRAL, SUBLANG_NEUTRAL), PWideString(s), sizeof(s)) = false) then begin

  ShowMessage(SysErrorMessage(GetLastError()));
end;

EndUpdateResource(res, false);

end;
Resourcedatei:

Delphi-Quellcode:
STRINGTABLE
BEGIN
10, "String1"
20, "String2"
30, "String3"
40, ""
50, ""
70, "String5"
END


Klappt irgendwie nicht :(

Kann mir jemand helfen?

Konkretes Problem: Wie übergebe ich bei UpdateResource die String-ID?

himitsu 22. Dez 2007 17:00

Re: UpdateResource
 
Behandelt UpdateResource eigentlich einzelne Strings, oder doch nur ganze StringTabellen?

http://www.delphipraxis.net/internal...135&highlight=

in den Resourcen sind ja imm bis zu 16 Strings in einer Resource drin und nicht einelne Strings.


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:46 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz