PDA

View Full Version : FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;



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".

Zyt3x
12-14-2011, 10:44 AM
This function is in SRL-5 already. It's found in smart.simba

BraK
12-14-2011, 03:02 PM
I'm failing to find it :/

https://github.com/MerlijnWajer/SRL-5/blob/master/SRL/misc/smart.simba