SRL Archive - SRL Snippets

FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;


BraK

2011-12-13 23:34:18

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

Gu3st...

2011-12-14 05:44:21

This function is in SRL-5 already. It's found in smart.simba

BraK

2011-12-14 10:02:38

I'm failing to find it :/

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