Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

mouse control(verry easy)

Posted on 2001-08-11
24
Medium Priority
?
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

604 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