Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Mouse_Event und PostKeyEx32 (https://www.delphipraxis.net/80025-mouse_event-und-postkeyex32.html)

hanspeter 1. Nov 2006 21:06


Mouse_Event und PostKeyEx32
 
Mit

Delphi-Quellcode:
Mouse_Event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
Mouse_Event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
Sende ich einen Mouseclick an ein anderes Programm

Mit
Delphi-Quellcode:
PostKeyEx32(VK_SHIFT,[ssRight],false);
kann ich an ein anderes Programm einen Tastendruck senden.

Aber wie sende ich Shifttaste und Mouseclick rechts an ein Programm?

Für einen Tip dankbar.

Mit Gruß Peter

hanspeter 2. Nov 2006 03:00

Re: Mouse_Event und PostKeyEx32
 
Also habe gefunden.
Ist eigentlich ganz einfach, ich hatte mich nur an der falschen API Funktion festgebissen.

Delphi-Quellcode:
procedure TAutoAnsage.Click;
begin
Keybd_Event(VK_SHIFT,0,0,0);
Mouse_Event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
Sleep(100);
Mouse_Event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
Keybd_Event(VK_SHIFT,0,KEYEVENTF_KEYUP,0);
end;
Gruß Peter


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:54 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz