05-11-2021, 10:45 AM
(05-06-2021, 11:43 AM)Jose Nilton Pace Wrote: Hi, try this code:
Code:procedure TFrmSesionUsuario.CerrarSesion(const AAppId: string);
var
lApp: TIWApplication;
I: Integer;
xList: TList;
foundit : boolean;
begin
foundit := false;
xList := GSessions.LockList(False);
try
for i := 0 to xList.Count - 1 do
begin
lApp := TIWApplication(xList[i]);
if lApp.AppID = AAppId then
begin
foundit := true;
break;
end;
end;
finally
GSessions.UnLockList(xList);
if (foundit = true) then
begin
lApp.Terminate;
end;
end;
end;
This code should not be used anymore (at least not in IW 15.1 and later). It simply won't complile.