Oracle monitor is not detected of terminated applications (do not work fully "delete inactive").
Need added check process in memory :
type
TMonitorClientPro = class(TMonitorClient);
procedure TForm1.BCleanMonitorClick(Sender: TObject);
var
i: Integer;
vClientDirectory: TClientDirectory;
vClientDirEntry: TClientDirEntry;
vCurrentProcessID, vProcessHandle: Integer;
begin
vCurrentProcessID := GetCurrentProcessID;
vClientDirectory := TMonitorClientPro(DOAClient).FClientDirectory;
for i := vClientDirectory.Count downto 1 do
begin
vClientDirEntry := vClientDirectory.ClientRec;
if vCurrentProcessID vClientDirEntry.ID then
begin
if not IsWindow(vClientDirEntry.ApplicationHandle) then
begin
vProcessHandle := OpenProcess(PROCESS_QUERY_INFORMATION, False, vClientDirEntry.ID);
if vProcessHandle = 0 then
vClientDirectory.RemoveClient(vClientDirEntry.ID)
else
CloseHandle(vProcessHandle);
end;
end;
end;
...
end;
Need added check process in memory :
type
TMonitorClientPro = class(TMonitorClient);
procedure TForm1.BCleanMonitorClick(Sender: TObject);
var
i: Integer;
vClientDirectory: TClientDirectory;
vClientDirEntry: TClientDirEntry;
vCurrentProcessID, vProcessHandle: Integer;
begin
vCurrentProcessID := GetCurrentProcessID;
vClientDirectory := TMonitorClientPro(DOAClient).FClientDirectory;
for i := vClientDirectory.Count downto 1 do
begin
vClientDirEntry := vClientDirectory.ClientRec;
if vCurrentProcessID vClientDirEntry.ID then
begin
if not IsWindow(vClientDirEntry.ApplicationHandle) then
begin
vProcessHandle := OpenProcess(PROCESS_QUERY_INFORMATION, False, vClientDirEntry.ID);
if vProcessHandle = 0 then
vClientDirectory.RemoveClient(vClientDirEntry.ID)
else
CloseHandle(vProcessHandle);
end;
end;
end;
...
end;