Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Blocking Button Press
#1
Hi,
I can get the accessible object of a button and use it's being pressed as a trigger throug the Properties-->Trigger-->

But the problem is that I want to test a certain condition when the user hovers over the button (Show Window, "tooltips_class32") and depending on that condition, either OK or block the actual button being pressed. When I am running a script that co-triggers with the button being pressed, this method works but not when I want to block the button being pressed.

I tried putting BlockInput2 3 as the first statement but it's too late at that point.

Any way to do this?

Stuart
#2
If the button is in your dialog, you can use WM_SETCURSOR message to detect when mouse is over, and EnableWindow to disable the button.

If it is in other program, and you cannot use an accessible trigger, then you can detect mouse movements using low level hooks (and also to block clicks), but it is not very easy, and it is not recommended to have many hooks.

Another idea - put an almost transparent toolbar over the button. On click, relay the click to the button or not.

Or enable the button when the condition is true, and disable when false.
#3
Thanks Gintaras..
It's in another application, so I think:
Quote:put an almost transparent toolbar over the button. On click, relay the click to the button or not.

will work perfectly!
Thanks again,
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)