Solved

mouse control(verry easy)

Posted on 2001-08-11
24
156 Views
Last Modified: 2012-05-04
hey guy's,
 does enny one have a documetation about mouse control. so i can move doubel click click on the screen?

already thanx
krydea
0
Comment
Question by:krydea
  • 13
  • 8
  • 3
24 Comments
 

Expert Comment

by:kyr
ID: 6376408
You will need to insert the mouse related messages in the system message queue. the only way to do it is by using Hooks.

Specifically search for the WH_JOURNALPLAYBACK Hook
in the Win32 Help Files.
0
 

Author Comment

by:krydea
ID: 6376415
is are the point's to low to give me some exampels?
0
 

Expert Comment

by:kyr
ID: 6376432
to simply position the mouse cursot use
 SetCursorPos(x,y);

for windows hooks related to mouse have a look here
http://www.prestwood.com/forums/delphi/sdug/newsletter/1998oct.html

you can also download the code from here:
http://www.geocities.com/SiliconValley/Lakes/4339/files/hook.zip

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:krydea
ID: 6376449
i realy men some thing like this lock the mouse and lets the compueter move and drop it<- mouse down.
if it's posible
0
 
LVL 34

Expert Comment

by:Slick812
ID: 6376661
hello krydea, you can position (move) the cursor (mouse) and click it (or do 2 clicks for double click) with windows API  
mouse_event(dwFlags,dx,dy,dwData,dwExtraInfo);

0
 
LVL 34

Expert Comment

by:Slick812
ID: 6376666
I don't really understand your question very well, could you say what you want to do. . . . . like move cursor to X=246 and y=397, and double click a button there
0
 

Author Comment

by:krydea
ID: 6376704
yea..
0
 

Author Comment

by:krydea
ID: 6376716
Slick812 : can you give a example?lets say ye have to use 2 integer X and Y click there... is that pisible?
if so plz mail the app to my mail addrs: Krydea@hotmail.com
0
 
LVL 34

Accepted Solution

by:
Slick812 earned 50 total points
ID: 6377657
yes it is posible, , , you can move the cursor to any place the your screen with - SetCursorPos(231,341) - and you click the screen where the cursor is with two mouse events, a left button down and a left button up-
mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);

mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

 - - - - - - - - - - - -
here is a button click event that will move the cursor and then Click it once. - -

private
    { Private declarations }
    X, Y: Integer;

procedure TForm1.Button1Click(Sender: TObject);
begin
{set X and Y to the Pixel position you want the cursor "HotSpot" to be in}

SetCursorPos(X,Y);

mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);

mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
{repeat the 2 mouse_event to do a double Click}

end;

- - - - - - - - - - - - - - -

ask me if you need more info

0
 

Expert Comment

by:kyr
ID: 6377909
thanks for the info Slick812. i wasn't aware of this function.
0
 

Author Comment

by:krydea
ID: 6385255
hey thanx iw ill give you the point's now:)
but can you tell me if you know something about the keyboard?:p
0
 
LVL 34

Expert Comment

by:Slick812
ID: 6386915
OK, I have done some Keyboard event code, but your question needs to ask for a certain thing about getting keyboard information. What is your problem ? or do you just need information ?
0
 
LVL 34

Expert Comment

by:Slick812
ID: 6386950
if you are a beginer in delphi programming, you should get a book and follow the lessions to learn about using delphi
0
 

Author Comment

by:krydea
ID: 6387399
just information to send key's as i typ them now etc..
0
 

Author Comment

by:krydea
ID: 6387401
can you help me?
0
 
LVL 34

Expert Comment

by:Slick812
ID: 6389180
"to send Keys" ? ? ? I do not understand this. can you give an example. like send keys to another TMemo when I am typing into a TMemo
0
 

Author Comment

by:krydea
ID: 6389504
yea your typing in to a memo or in to a edit in explorer  like typing into a ader programme.. is that posible?
0
 
LVL 34

Expert Comment

by:Slick812
ID: 6391249
I have trouble understanding what you need, , , "a memo or in to a edit in explorer" does windows explorer have an edit or memo ? ? ? It is posible to get the keyboard "typing" even if your program does not have the keyboard focus, , , ,  "like typing into a ader programme" but you have to make a  .DLL  to get windows system keyboard output, because your program ONLY gets keyboard when it has "Focus", do you want me to Email you some Info about this? ? maybe you could explain more what you want to do
0
 

Author Comment

by:krydea
ID: 6391329
yea plz send me some info Krydea@hotmail.com.
k better explaning.
yea typing in to a memo would be fine.. so not set the text but put them as a mounsepost. look you send a message to windows and then he sets the mouse somewere you do that with SetCursorPos right it it posible that my programme sends key's..
example:
a programme we add a edit and a button when we click on the button the mouse moves to the edit and typs there something in but not with edit.lines.add or with edit.text but put the keys in it as you do with the SetCursorPos..

hope this is explaned better.
0
 

Author Comment

by:krydea
ID: 6391331
maybe you can call it keyboard control..?
0
 

Author Comment

by:krydea
ID: 6397758
hey men can you help me or not if you don't whant to help me just say it and don't let me waiting for mail from you or EE
0
 
LVL 34

Expert Comment

by:Slick812
ID: 6398694
sorry I will send Email today, been busy here
0
 

Author Comment

by:krydea
ID: 6399737
k sorry for pusing..
0
 

Author Comment

by:krydea
ID: 6406881
hey,
i did my homework for is project the only thing i need to know is how to get the handel of the edit \ memo where my mouse is going over...
can't you only help me with that plz..

krydea
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Newbie Thread Programming 1 161
Delphi XE10, MySQL Query 4 164
oracle global variables 4 76
Open a URL with Internet Explorer in a new tab (not a new window) 1 120
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question