|
-
Nov 20th, 2004, 08:44 PM
#1
Thread Starter
Addicted Member
Send Mouse Key? [Resolved]
Hi,
Can I send a mouseclick?
Like is for keys from your keyboard.....but how can I do this from the mouse?
Thanks
Last edited by Rogier; Nov 24th, 2004 at 07:38 AM.
-
Nov 20th, 2004, 09:09 PM
#2
you can call a control's click event like a subroutine. (maybe I should give you a goofy answer instead)
-
Nov 20th, 2004, 09:10 PM
#3
Thread Starter
Addicted Member
-
Nov 20th, 2004, 09:10 PM
#4
we don't need replies to the things that you don't know.
-
Nov 20th, 2004, 09:13 PM
#5
Thread Starter
Addicted Member
OK I'm really sorry......I was typing and meanwhile I thougt: "no, that's not the answer"
Sorry
-
Nov 20th, 2004, 10:41 PM
#6
The picture isn't missing
Do you just want to send a click, or is there a target?
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Nov 20th, 2004, 10:48 PM
#7
is it your program, or do you want to click on someone else's program? btw - You could just use {Enter} instead of a click.
-
Nov 21st, 2004, 12:25 PM
#8
Software Eng.
Look into the mouse_event API, which will simulate a mouse click where ever the cursor is.
If you want to target a specific window, use the SendMessage API to send the WM_LBUTTONDOWN, and WM_LBUTTONUP messages.
Last edited by Megatron; Nov 22nd, 2004 at 05:17 PM.
-
Nov 22nd, 2004, 08:52 AM
#9
Thread Starter
Addicted Member
I want to click in an other window.
Like: you press a button and 3 seconds later the mouse clicks one time, doesn't matter in what windows you are.
-
Nov 22nd, 2004, 05:17 PM
#10
Software Eng.
Two methods (as described in my earlier post).
Method 1)
-Use FindWindow to get the handle of the window
-If necessary, position the cursor via SetCursorPos
-Invoke the mouse_event() API to click the mouse
Method 2)
-Get the handle of window via FindWindow
-Send the WM_LBUTTONDOWN and WM_LBUTTONUP messages to it
-
Nov 23rd, 2004, 08:58 AM
#11
Thread Starter
Addicted Member
hmmm......I think I am missing some files..........because I don't see one of that API's
-
Nov 23rd, 2004, 04:25 PM
#12
Software Eng.
-
Nov 24th, 2004, 07:38 AM
#13
Thread Starter
Addicted Member
I don't know. Thanks for your help, I'll call this trheat Resolved, it isn't but that doesn't matter anymore.
thnx
-
Nov 24th, 2004, 04:44 PM
#14
Software Eng.
If you can get the declarations, this should do the trick
Code:
handle = FindWindow("ClassName", "WindowTitle")
If Handle Then
PostMessage handle, WM_LBUTTONDOWN, MK_LBUTTON, 0
PostMessage handle, WM_LBUTTONUP, MK_LBUTTON, 0
End If
-
Dec 21st, 2004, 12:13 AM
#15
New Member
Re: Send Mouse Key? [Resolved]
how do i make a program to click on specific coordinate x and y
-
Dec 22nd, 2004, 11:24 AM
#16
Thread Starter
Addicted Member
Re: Send Mouse Key? [Resolved]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|