Jump to content

Click on invisible part of GUI


Recommended Posts

Hello,

Is it possible to mouse click on a non-visible part of GUI without scrolling and making it visible on the screen? I have used a MouseClickPlus function found on the forum but it is not quite working. I am mostly interested in a technical solution or and advice rather than some piece of code.

Thanks a lot,

Ionut

Link to comment
Share on other sites

I am actually trying to click on a check box belonging to a control. In my GUI these 2 are seen are separate entities. The check box control is activated only if the mouse is hovered on top of it. So this works:

MouseMove(255,145)
ControlClick("IxLoad", "", "[NAME:checkEnableCommunity]" , "left")

while this does not work:

ControlClick("IxLoad", "", "[NAME:checkEnableCommunity]" , "left")

Since there are multiple controls named "checkEnableCommunity" on the not-visible part of GUI I need to find out a way to click on them w/o scrolling. Thinking of it now, it seems kind of impossible.

Ionut

Link to comment
Share on other sites

  • Moderators

Try sending WM_MOUSEHOVER to the control handle before using control click. ( or maybe use _GUICtrlCheckBox* functions instead ).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Try sending WM_MOUSEHOVER to the control handle before using control click. ( or maybe use _GUICtrlCheckBox* functions instead ).

Hi Sm0ke N,

The GUI I'm using has different panels which can be pinned/unpinned and block the mouse access to the control behind it, although it is "visible" for the script. Hovering on top of the control won't help if blocked by the panel. For instance, the following code has returned success, even if the Network1 control has not been actually clicked.

ConsoleWrite(ControlCommand("IxLoad", "", "[TEXT:Network1]", "IsVisible", "") & @CRLF)
ConsoleWrite(ControlClick("IxLoad", "", "[TEXT:Network1]") & @CRLF)
ConsoleWrite(ControlFocus("IxLoad", "", "[TEXT:Network1]") & @CRLF)
$pos=ControlGetPos("IxLoad", "", "[TEXT:Network1]")
ConsoleWrite($pos[0] & $pos[1] & @CRLF)
MouseMove($pos[0], $pos[1])
ConsoleWrite(MouseClick("left", $pos[0], $pos[1]) & @CRLF)

Return:

1

1

1

293111

1

I've attached a snapshot of the application. The gray panel on which is written Traffic1 can be places on the Network1 object, still making it visible for the script, but not clickable.

Since now I found a way to scroll into this GUI, is there a possibility to check if a control is on the visible screen and reachable by a MouseClick()? This will solve my problem.

Thanks a lot,

Ionut

post-56932-12803264669276_thumb.jpg

Link to comment
Share on other sites

  • Moderators

Non-Standard controls don't like standard control/window api calls.

I was merely offering a suggestion to trick the control into thinking you're hovering over with the mouse.

You're question doesn't pertain to anything I said, so I'm a bit confused on why you addressed it to me specifically.

Again, you'll more than likely need to look at:

SendMessage: http://msdn.microsoft.com/en-us/library/ms644950%28VS.85%29.aspx ( I believe someone made a wrapper for it in the UDF portion of AutoIt's includes ).

WM_MOUSEHOVER: http://msdn.microsoft.com/en-us/library/ms645613%28VS.85%29.aspx ( Probably included in WindowsConstants.au3, but how to use it is on the msdn link ).

Or resort to some non standard practices obviously not widely used.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...