s.a
Mouse imkeçini istediğimiz koordinatlara nasıl taşıyabiliriz?
imleçi haraket ettirmek
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
- sadettinpolat
- Moderator
- Mesajlar: 2131
- Kayıt: 07 Ara 2003 02:51
- Konum: Ankara
- İletişim:
- pasa_yasar
- Üye
- Mesajlar: 570
- Kayıt: 07 Haz 2004 12:35
Kod: Tümünü seç
//simulating mouse click
//we need 2 buttons on the form
procedure TForm1.Button1Click(Sender: TObject) ;
var
Pt : TPoint;
begin
Application.ProcessMessages;
{Get the point in the center of Button 2}
Pt.x := Button2.Left + (Button2.Width div 2) ;
Pt.y := Button2.Top + (Button2.Height div 2) ;
{Convert Pt to screen coordinates and Mickeys}
Pt := ClientToScreen(Pt) ;
Pt.x := Round(Pt.x * (65535 / Screen.Width)) ;
Pt.y := Round(Pt.y * (65535 / Screen.Height)) ;
{Simulate the mouse move}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_MOVE,
Pt.x, Pt.y, 0, 0) ;
{Simulate the left mouse button down}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_LEFTDOWN,
Pt.x, Pt.y, 0, 0) ;;
{Simulate the left mouse button up}
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_LEFTUP,
Pt.x, Pt.y, 0, 0) ;;
end;
Kod: Tümünü seç
Mouse_Event(MOUSEEVENTF_ABSOLUTE or
MOUSEEVENTF_MOVE,
Pt.x, Pt.y, 0, 0) ;