Forum: Win32/Win64 API (native code)
Delphi
by omata,
12. Jan 2010
procedure TForm1.Button1Click(Sender: TObject);
var P:TPoint;
X, Y:integer;
begin
X:=100;
Y:=100;
if GetCursorPos(P) then begin
SetCursorPos(X, Y);
Mouse_Event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Mouse_Event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
Forum: Win32/Win64 API (native code)
Delphi
by omata,
12. Jan 2010
MakeMouseClick ist doch eine eigene Methode.
Forum: Win32/Win64 API (native code)
Delphi
by omata,
12. Jan 2010
Ne, kann deine Probleme nicht nachvollziehen.
Versuche es deshalb mal so, in der Hoffnung, dass dir das besser gefällt:
procedure TForm.MakeMouseClick(X, Y:integer);
var P:TPoint;
begin
if GetCursorPos(P) then begin
SetCursorPos(X, Y);
Mouse_Event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Forum: Win32/Win64 API (native code)
Delphi
by omata,
12. Jan 2010
Ok...
Aufruf:
var P:TPoint;
begin
P.X:=100;
P.Y:=100;
MakeMouseClick(P);
end;
Forum: Win32/Win64 API (native code)
Delphi
by omata,
12. Jan 2010
Was spricht gegen folgendes?
procedure TForm.MakeMouseClick(AP: TPoint);
var P:TPoint;
begin
if GetCursorPos(P) then begin
SetCursorPos(AP.X, AP.Y);
Mouse_Event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Mouse_Event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
SetCursorPos(P.X, P.Y);