fix: re-introducing the removed TTarget target properties#565
Open
Torwent wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Test script if you want: {$loadlib Plugins/wasp-plugins/libremoteinput/libremoteinput}
var
trgt: Pointer;
winTrgt: TWindowHandle;
canvas: TExternalCanvas;
pid: TProcessID;
procedure InjectNPair();
var
timer: TCountDown;
begin
winTrgt := GetSimbaTargetWindow();
pid := winTrgt.GetPID();
RIInject(pid);
timer.Start(2000);
repeat
trgt := EIOS_PairClient(pid);
if trgt <> nil then
Break;
Sleep(100);
until timer.IsFinished;
end;
procedure PrintTargetInfo();
begin
WriteLn Target.ToString();
WriteLn Target.WindowTarget;
WriteLn Target.ImageTarget;
WriteLn Target.EIOSTarget;
WriteLn Target.PluginTarget;
WriteLn('TARGET: ', trgt);
WriteLn('WINDOW: ', winTrgt);
end;
var
img: TImage;
begin
img := new TImage(500, 500);
InjectNPair();
SetWriteColor($00FFFF);
WriteLn('Window: ');
PrintTargetInfo();
Target.SetImage(img);
SetWriteColor($0000FF);
WriteLn(LINE_SEP, 'Image: ');
PrintTargetInfo();
Target.SetEIOS({$MACRO LOADEDLIB(libremoteinput)}, ToStr(pid));
SetWriteColor($FF0000);
WriteLn(LINE_SEP, 'EIOS: ');
PrintTargetInfo();
Target.SetPlugin({$MACRO LOADEDLIB(libremoteinput)}, ToStr(pid), canvas);
SetWriteColor($FFFF00);
WriteLn(LINE_SEP, 'Plugin: ');
PrintTargetInfo();
end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've done this from scratch without following the original so I'm not sure if I did this in a way you would like @ollydev so feel free to edit to your liking or just redo the whole thing.
I'm also not sure if the
TTarget.ImageTargetI added makes much sense, but I did it for completion sake.Personally I only need the Window, EIOS and Plugin.
I can imagine
ESimbaTargetKindhaving some uses but I only bothered with the things I needed so I don't need to be parsingTTarget.ToString()anymore.I also tested all target kinds and this seems to be working as I would expect but do review please