1
I’m making a simple system, in this FORM has 2 button, one that performs the function and another that I put a SHOWMESSAGE('teste ok');
and I took the POSITION of this second BUTTON, remembering that I need to use the SENDMESSAGE
for the MOUSE CURSOR not to move on the screen, so I made the following program:
Procedure SendMouseClick(x,y:Integer);
var
h:THandle;
begin
h := FindWindow(nil, 'TForm1');
SendMessage(h, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x,y));
sleep(10);
SendMessage(h, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(x,y));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SendMouseClick(1042,538);
end;
It turns out I click and just do nothing on my FORM. What I might be missing?
Friend, thank you her reply.... and if I want to click a certain position out of the FORM, as I should do ?
– user7605
@user7605 Stackoverflow is not like a forum. If the answer satisfied your question you should accept it as an answer. If you want a slightly different answer, change your question including what you need. If you need to ask another question then, well... ask another question.
– EMBarbosa
I already changed my question friend!!
– user7605