AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WM_LBUTTONDOWN Help

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ProsperousOne



Joined: 19 Sep 2005
Posts: 96

PostPosted: Wed Jan 16, 2008 10:25 pm    Post subject: WM_LBUTTONDOWN Help Reply with quote

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
View user's profile Send private message
ProsperousOne



Joined: 19 Sep 2005
Posts: 96

PostPosted: Wed Jan 16, 2008 11:40 pm    Post subject: Reply with quote

Update:

If use hover the mouse over the control, and use

Code:

Click, Down


The button stays pressed....

Hmmmmmmmmmmm Any thoughts? Idea
Back to top
View user's profile Send private message
ProsperousOne



Joined: 19 Sep 2005
Posts: 96

PostPosted: Thu Jan 17, 2008 12:44 am    Post subject: Reply with quote

After much trial (with lots of error), I'm wondering why
Code:
Click, Down
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
View user's profile Send private message
ProsperousOne



Joined: 19 Sep 2005
Posts: 96

PostPosted: Thu Jan 17, 2008 1:22 am    Post subject: Reply with quote

I confirmed that if I first move the mouse to the control, then send a WM_LBUTTONDOWN message, that it works! Laughing

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
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2558
Location: Australia, Qld

PostPosted: Thu Jan 17, 2008 2:18 am    Post subject: Reply with quote

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. Very Happy
Back to top
View user's profile Send private message
ProsperousOne



Joined: 19 Sep 2005
Posts: 96

PostPosted: Thu Jan 17, 2008 7:12 pm    Post subject: Reply with quote

I thinkyou're right... It must be the app... (BASTARDS! Evil or Very Mad )

Gonna try skinning this cat with another tool.

Fish Scaler anyone? Twisted Evil
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group