Hello villavu long time since actively posting but life has been busy and good now 30 years old with a 10 year old daughter asking me to create a bot for them with the little time i get on my desktop im starting to struggle to get what i had envisioned.
Simba Code:
procedure CrAPPA.GhostMouse(X, Y, ClickType: Integer);
var
Pos: TPoint;
begin
Pos := Target.ScreenToClient(point(X, Y));
case ClickType of
0:
begin
//Target.Perform(WM_SETFOCUS, Target, null);
//test Sendmessage(Target, WM_MOUSEMOVE, 0, MakeLParam(Pos.X, Pos.Y));
sendmessage(Target, WM_LBUTTONDOWN, MK_LBUTTON, MakeLParam(Pos.X, Pos.Y));
Wait(100);
sendmessage(Target, WM_LBUTTONUP, MK_LBUTTON, MakeLParam(Pos.X, Pos.Y));
end;
1:
begin
PostMessageA(Target, WM_RBUTTONDOWN, MK_RBUTTON, MakeLParam(Pos.X, Pos.Y));
Wait(100);
PostMessageA(Target, WM_RBUTTONUP, MK_RBUTTON, MakeLParam(Pos.X, Pos.Y));
end;
end;
end;
She wants the bot to run without losing control of her computer first thing that sprung to mind was the old GhostMouse for scar by kaitnieks
and this is the best i can come up with to my knowledge to replicate it.
I've also had trouble with PostMessage when left clicking while SendMessage seems to Correct this issue by forcing the message ahead of all i'm still facing problems while form has focus it misses the odd click yet the real mouse does not enter the forms bounds yet while selecting any other window to remove focus it works flawless.
I'm now asking for help with what method should i be using to accomplish this i have tried to find articles on how to create a secondary cursor like teamviewer but within my app blocked from all interference but cant find any infomation other than software which allows two hardware mice.