Jump to content
Sign in to follow this  
SRD

Clicking subcontrols within a control

Recommended Posts

Hi. I'm trying to use ControlClick to select a saved session in Putty.

The control ID is 1052, and this refers to the entire area where you can load, save or delete a saved session:

Posted Image

I want to click on Nagios. I've tried specifying the coordinates of the click:

ControlClick ("PuTTY Configuration", "", 1052, "left", 1, 32, 80);

but this doesn't work.

What do I need to do? Thanks.

Share this post


Link to post
Share on other sites

In Putty, I have to click on Nagios first. I can double click on it without needing to click on Load.

Share this post


Link to post
Share on other sites

I'm guessing there is a invisible control covering all the controls in the "Load, save or delete a stored sessions" group. (perhaps group controls do this themselves)

The control that you want to click looks like it could be a ListBox.

Use this script to try and get all the controls within the window. That way you can look for a control that is most likely the one you want to click and send the ControlClick to that one, or use ControlCommand on it.

#Include <WinAPI.au3>
#include <array.au3>

$hWnd = WinGetHandle("PuTTY")
If Not $hWnd Then 
    ConsoleWrite("Putty Window not found" & @CRLF)
    Exit
EndIf
$aControls = _WinAPI_EnumWindows(True, $hWnd)
_ArrayDisplay($aControls)

You could also blindly try to use "[CLASSNN:ListBox1]"

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...