BraK
12-14-2011, 04:34 AM
A handy function for Outside of RS.
var
ClientArea: TBox;
function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T: TSysProcArr;
I: Integer;
begin
T:= GetProcesses();
for I := 0 to high(T) do
if StartsWith(TitlePrefix, T[i].Title) then
begin
Result := True;
if SetAsTarget then
begin
SetTarget(T[i]);
ActivateClient;
ClientArea := IntToBox(1, 1, X2 - 1, Y2 - 1);
end;
end;
end;
Wizzup changed the name though I used to call it "ClientExist".
var
ClientArea: TBox;
function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T: TSysProcArr;
I: Integer;
begin
T:= GetProcesses();
for I := 0 to high(T) do
if StartsWith(TitlePrefix, T[i].Title) then
begin
Result := True;
if SetAsTarget then
begin
SetTarget(T[i]);
ActivateClient;
ClientArea := IntToBox(1, 1, X2 - 1, Y2 - 1);
end;
end;
end;
Wizzup changed the name though I used to call it "ClientExist".