 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ProsperousOne
Joined: 19 Sep 2005 Posts: 96
|
Posted: Wed Jan 16, 2008 10:25 pm Post subject: WM_LBUTTONDOWN Help |
|
|
Every time I click and hold down a button Control (a "real click") on an app, the button stays depressed, and window spy shows a WM_LBUTTONDOWN message (0x201,1,0x00190019) [==>Lbutton down, at coords 25,25).
When I release the left mouse button, the window sends the WM_LBUTTONUP message, as it should.
However, when I try to post the exact same WM_LBUTTONDOWN message with the same parameters, via postmessage or sendmessage, Windowspy show that a WM_LBUTTONUP message is immedialy sent to the window, even thought I never implicityly send it!
| Code: |
F2::
WM_LBUTTONDOWN = 0x201
PostMessage, WM_LBUTTONDOWN, 1,0x00140019, Button4, ahk_id %winID%
Return
|
I have the same results even when I use ControlClick with the "D" option. Ive tried the NA option as well as SetDelay,-1 to no avail also.
Ugh... very frustrating. Any way to "trick" it or is there another WM_HOLDDOWNTHEFRICKINGLBUTTON command I'm not aware of?
Any help is greatly appreciated....
Thx! |
|
| Back to top |
|
 |
ProsperousOne
Joined: 19 Sep 2005 Posts: 96
|
Posted: Wed Jan 16, 2008 11:40 pm Post subject: |
|
|
Update:
If use hover the mouse over the control, and use
The button stays pressed....
Hmmmmmmmmmmm Any thoughts?  |
|
| Back to top |
|
 |
ProsperousOne
Joined: 19 Sep 2005 Posts: 96
|
Posted: Thu Jan 17, 2008 12:44 am Post subject: |
|
|
After much trial (with lots of error), I'm wondering why
would work, but not
| Code: | PostMessage, WM_LBUTTONDOWN, 1,0x00140019, Button4, ahk_id %winID%
|
I'm guessing it has to do with the "physical" location of the mouse. As soon as my PostMessage is executed, the system realizes that the "real" mouse is not where it thinks it is, so it immediately "grabs" the mouse where ever else it is on the screen (which is NOT over the button I'm activating) and hence a "WM_LBUTTONUP" message is generated.
Is there any way to temporarily diable the mouse, so the system thinks it's still pressing the button down as a result of the last WM_LBUTTONDOWN message?
Many thanks! |
|
| Back to top |
|
 |
ProsperousOne
Joined: 19 Sep 2005 Posts: 96
|
Posted: Thu Jan 17, 2008 1:22 am Post subject: |
|
|
I confirmed that if I first move the mouse to the control, then send a WM_LBUTTONDOWN message, that it works!
Unfortunatley, I don't want to have this window visible to the user. Is there any way to trick the system into thinking the mouse is somewhere other than where it is?
I'm about to checkout nomousey... |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Thu Jan 17, 2008 2:18 am Post subject: |
|
|
| Quote: | | I'm guessing it has to do with the "physical" location of the mouse. As soon as my PostMessage is executed, the system realizes that the "real" mouse is not where it thinks it is, so it immediately "grabs" the mouse where ever else it is on the screen (which is NOT over the button I'm activating) and hence a "WM_LBUTTONUP" message is generated. | This is not something that the system does. To demonstrate:
| Code: | Gui, Add, Button, W100 gonclick
Gui, Show
Gui, +LastFound
Sleep, 1000
ControlClick, Button1,,,,, D ; WM_LBUTTONDOWN
Sleep, 1000
ControlClick, Button1,,,,, U ; WM_LBUTTONUP
return
onclick:
MsgBox click
ExitApp
return | Perhaps the target application is behind it. Also note ControlClick works by posting mouse messages.
Doesn't seem like there is a solution, but hopefully someone will prove me wrong.  |
|
| Back to top |
|
 |
ProsperousOne
Joined: 19 Sep 2005 Posts: 96
|
Posted: Thu Jan 17, 2008 7:12 pm Post subject: |
|
|
I thinkyou're right... It must be the app... (BASTARDS! )
Gonna try skinning this cat with another tool.
Fish Scaler anyone?  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|