有没有知道怎么修改resourcestring里面的字符串的值??
unit TestConsts;interface
resourcestring
TestString = 'hello,delphi!';implementationend.
比如我想将TestString这个字符串值改为‘你好’ beginUpdateResource
UpdateResource
EndUpdateResource 如果有这几个函数的实例也行
unit TestConsts;interface
resourcestring
TestString = 'hello,delphi!';implementationend.
比如我想将TestString这个字符串值改为‘你好’ beginUpdateResource
UpdateResource
EndUpdateResource 如果有这几个函数的实例也行
TestString: string;...
如果是,那么:
更换一个 EXE 的字符串表?
先有这样的字符资源:
STRINGTABLE
{
1, "abcdefghijklmnopqrstuvwxyz"
}
function ChangeString(const FileName;NewString: string): Boolean;
var
hUpdate: Cardinal;
s:string;
begin
Result:= False;
hUpdate:= BeginUpdateResource('d:\demo.exe', false);
if hUpdate = 0 then Exit;
try
s:=NewString;
Result:= UpdateResource(hUpdate, 'String Table','1', 0, @s[1], Length(s));
finally
EndUpdateResource(hUpdate, not Result);
end;
end;
begin
if language = chinese then
cxSetResourceString(@CSHello, '嗨, 你好'); if language = english then
cxSetResourceString(@CSHello, 'Hello');
end;使用的时候 cxGetResourceString(@CSHello)
还是没有达到我的预期目标,在不修改控件控件代码的前提下修改resourcestring里面字符串的值。