[request] TC-language in FsDefaultParamStruct
Moderators: white, Hacker, petermad, Stefan2
[request] TC-language in FsDefaultParamStruct
Would it be possible to pass the language of TC to the plugin?
I'm running with 'wcmd_deu.lng' and want my plugin to know that. Of is there an other way to figure that out?
I'm running with 'wcmd_deu.lng' and want my plugin to know that. Of is there an other way to figure that out?
Re: [request] TC-language in FsDefaultParamStruct
Which plugin do you mean?Jonas wrote:Would it be possible to pass the language of TC to the plugin?
I'm running with 'wcmd_deu.lng' and want my plugin to know that. Of is there an other way to figure that out?
AFAIK plugins don't use TC language files. Only some of them are multilanguage but they use their own language files. In this case you can choose your favourite one or translate the orignal one into your language (and share it to others )
Oh it is. First check the registry, then the windows dir. If not found then let the user tell you, use default or forget about it.
A bit of TCME code:
HTH
Roman
A bit of TCME code:
Code: Select all
// returns the wincmd.ini location
function GetIniLoc: string;
var
reg: tregistry;
strn: string;
i: integer;
begin
// check if the wincmd.ini location wasn't specified as a command line parameter
for i := 1 to paramcount do
if ansistartstext('ini=', paramstr(i)) then
begin
strn := copy(paramstr(i), 5, length(paramstr(i)));
break;
end;
// if it wasn't specified we'll have to look in the registry
if strn = '' then
begin
reg := tregistry.create;
if reg.KeyExists('SOFTWARE\Ghisler\Total Commander') then
begin
reg.openkeyreadonly('SOFTWARE\Ghisler\Total Commander');
if reg.ValueExists('IniFileName') then
strn := reg.ReadString('IniFileName');
end;
if strn = '' then // as it wasn't in HKCU we're switching to HKLM
begin
reg.RootKey := HKEY_LOCAL_MACHINE;
if reg.KeyExists('SOFTWARE\Ghisler\Total Commander') then
begin
reg.openkeyreadonly('SOFTWARE\Ghisler\Total Commander');
if reg.ValueExists('IniFileName') then
strn := reg.ReadString('IniFileName');
end;
end;
// if it still isn't found or is just wincmd.ini we assume it's in the windows dir
if (strn = '') or (lowercase(strn) = 'wincmd.ini') then
if fileexists(GetEnvironmentVariable('windir') + '\wincmd.ini') then
strn := GetEnvironmentVariable('windir') + '\wincmd.ini';
reg.Free;
end;
getiniloc := strn;
end;
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Of course, registry ckecking isn't difficult, but...Hacker wrote:Oh it is. First check the registry, then the windows dir. If not found then let the user tell you, use default or forget about it.
Code: Select all
// returns the wincmd.ini location
// check if the wincmd.ini location wasn't specified as a command line parameter
for i := 1 to paramcount do
if ansistartstext('ini=', paramstr(i)) then
begin
strn := copy(paramstr(i), 5, length(paramstr(i)));
break;
end;
Ask the user (or use some default). There is really no other feasible way I'd know of (except getting into TC's memory and look there somewhere ).
Roman
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.