Jump to content

How to get control class name or id in win10


mehafi
 Share

Recommended Posts

Hi,

In win8 I can use AutoIt v3 Window Info to get control Class Name or ID - example printscreen win8_calc_class.png - I can identify any button of calculator

But in win10 the sam action show me the same Class Name ( ApplicationFrameInputSkinWindow1 )  and in fact all data except Control Click Cords are the same for almost entire surface of calculator ( win10_calc_btn_noclass.png ). The same in application writen in C++ QT - I can not identify buttons Refresh and Cancel to click on them, what is my purpose ( tableau_refreshAll_noClass.png ).

Does anyone have any suggestions / solutions ?

thanks in advance

win8_calc_class.png

win10_calc_btn_noclass.png

tableau_refreshAll_noClass.png

Link to comment
Share on other sites

@Subz - no, therre are no underlines. I gues what  probably you want to advise - underline means keyboard shortcuts means I could use Send function to 'press' this button.

@junkew - on printscren is what inspect.exe shows me when I point the button in dialog box which I am intrested. So there is no Class Name, Id ... is there a way I can identify this button and press / click on it ?

Inspect_btnResult.png

Link to comment
Share on other sites

I have tried:

Local $hControl = ControlGetHandle( $hWndRefreshWindow, "", "[TEXT:Close Enter]" )

Local $hControl = ControlClick( $hWndRefreshWindow, "", "", "left")

Local $hControl = ControlClick( $hWndRefreshWindow, "", "", "right")

 

but it not works

Link to comment
Share on other sites

@Subz unfortunatelly it does not works.

I used:

Local $x = ControlClick( $hWndRefreshWindow, "", "", "", 1, 832, 704) ; values returned in Bounded rectangle property by Inspect.exe

Local $x = ControlClick( $hWndRefreshWindow, "", "", "", 1, 235, 290) ; values counted by my related to the top left corner of dialog box

Local $x = ControlClick( $hWndRefreshWindow, "", "", "", 1, 5, 5) ; values related to top left corner of button

Interesting - function return 1 = success, but button is not presed

Link to comment
Share on other sites

What about:

;~ Cancel Button
If WinActive('[CLASS:QT5QWindow]') Then
    $QT_REFRESH = WinGetPos('[CLASS:QT5QWindow]', '')
    ControlClick('[CLASS:QT5QWindow]', 'Refresh All Extracts', '', 'left', 1, $QT_REFRESH[2] - 50, $QT_REFRESH[3] - 20)
EndIf
;~ Refresh Button
If WinActive('[CLASS:QT5QWindow]') Then
    $QT_REFRESH = WinGetPos('[CLASS:QT5QWindow]', '')
    ControlClick('[CLASS:QT5QWindow]', 'Refresh All Extracts', '', 'left', 1, $QT_REFRESH[2] - 130, $QT_REFRESH[3] - 20)
EndIf

 

Link to comment
Share on other sites

Strange but:

 Local $hWndRefreshWindow = WinWaitActive("[CLASS:Qt5QWindow]")   ; works and return correct hwnd

bu later:

$QT_REFRESH = WinGetPos("[CLASS:Qt5QWindow]")      ; NOT works

but

$QT_REFRESH = WinGetPos($hWndRefreshWindow)   ; WORKS

 

 

arrayDisplay.PNG

Link to comment
Share on other sites

apparently you did not read faq 31 thru with the reference to iuiautomation in examples.

As you can see it with AU3Inf, Simplespy and Inspect its possible to click

Different solutions

  • use the treewalkers in example 1 of uiautomation
  • use the uiawrappers with index n or offset n or relative n
  • use the AutoIt logic of index n
Link to comment
Share on other sites

So then can you now try:

;~ Refresh Button
MouseClick('left', $QT_REFRESH[0] + $QT_REFRESH[2] - 130, $QT_REFRESH[1] + $QT_REFRESH[3] - 20)

;~ Cancel Button
MouseClick('left', $QT_REFRESH[0] + $QT_REFRESH[2] - 50, $QT_REFRESH[1] + $QT_REFRESH[3] - 20)

Edited by Subz
Typos - Added Cancel
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...