Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
UYGULAMAYA MOUSLA TIKLATMA
#1
MERHABA ARKADAŞLAR BİR UYGULAMAYA MOUSLA SAĞ VE SOL TIKLATMA YAPMAK İSTİYORUM AMA SADECE UYGULAMAYA GÖNDERMEK İSTİYORUM YAZI VS GÖNDERİYORUM KLAVYE TUŞLARINIDA AMA BİR TÜRLÜ SAĞ VE SOL TIKLAMA YAPAMADIM 

BEGİN
Var
  wnd: HWND;
  i: Integer;
  s: string;
begin
  wnd := FindWindow('notepad', nil);
  if wnd <> 0 then
  begin
    wnd := FindWindowEx(wnd, 0, 'Edit', nil);


    s := 'Hello';
    for i := 1 to Length(s) do
      SendMessage(wnd, WM_CHAR, Word(s[i]), 0);

    PostMessage(wnd, WM_KEYDOWN, VK_RETURN, 0);

    PostMessage(wnd, WM_KEYDOWN, VK_SPACE, 0);
    PostMessage(wnd, MOUSEEVENTF_LEFTDOWN, 0, 0);
    PostMessage(wnd, MOUSEEVENTF_LEFTUP, 0, 0);
  end;
end;
Cevapla
#2
Merhaba,
Projem içerisinden direkt kopyala yapıştır yapıyorum.

procedure TFormRevolution.ClickAndSlide(startX,startY,finishX,finishY:Integer);
var
 hwnd:THandle;
 i:integer;
begin
 hwnd :=FindWindow(nil,'Knight Online Client');
 SetForegroundWindow(hwnd);
 Sleep(200);
 SetCursorPos(startX, startY);
 mouse_event(MOUSEEVENTF_RIGHTDOWN, startX, startY, 0, 0);
 mouse_event(MOUSEEVENTF_MOVE or MOUSEEVENTF_ABSOLUTE, finishX, finishY, 0, 0);
 mouse_event(MOUSEEVENTF_RIGHTUP, finishX, finishY, 0, 0);
 SetCursorPos(finishX, finishY);
end;

procedure TFormRevolution.ClickMouse(X, Y: Integer; Button: TMouseButton; const sleepTime:integer = 300);
var
 hwnd:THandle;
begin
 hwnd :=FindWindow(nil,'Knight Online Client');
 SetForegroundWindow(hwnd);
 SetCursorPos(X, Y);
 case Button of
 mbLeft: begin
     mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
     Sleep(sleepTime);
     mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
     Sleep(40);
     mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
   end;
   mbRight: begin
     mouse_event(MOUSEEVENTF_RIGHTDOWN, x, y, 0, 0);
     Sleep(sleepTime);
     mouse_event(MOUSEEVENTF_RIGHTUP, x, y, 0, 0);
     Sleep(sleepTime/2);
     mouse_event(MOUSEEVENTF_RIGHTUP, x, y, 0, 0);
   end;
   mbMiddle: begin
     mouse_event(MOUSEEVENTF_MIDDLEDOWN, x, y, 0, 0 );
     Sleep(sleepTime);
     mouse_event(MOUSEEVENTF_MIDDLEUP, x, y, 0, 0 );
     Sleep(sleepTime/2);
     mouse_event(MOUSEEVENTF_MIDDLEUP, x, y, 0, 0 );

   end;
 end;
end;
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  Uygulamaya responsive görünüm nasıl kazandırabilriz ? delphicim 0 392 04-01-2024, Saat: 15:24
Son Yorum: delphicim
  Mouse Tıklatma apachi2006 7 2.644 08-02-2022, Saat: 11:57
Son Yorum: apachi2006
  Bir yarışma web sayfasındaki Butona Tıklatma Jakarta2 11 3.764 31-01-2022, Saat: 19:00
Son Yorum: Jakarta2
  Geliştirdiğim uygulamaya dil paketi ekleme tuna 5 1.674 05-11-2021, Saat: 08:36
Son Yorum: 3ddark



Konuyu Okuyanlar: 1 Ziyaretçi