Jump to content
nbg15

List Content of "Qt5QWindowIcon" Class

Recommended Posts

nbg15

Hello everybody,

i've spent hours to google and find out how to get content of scrollable list view of our CMS Software...

i checked it with the "AutotIT window info" tool, but the only things I get are this:

Class: Qt5QWindowIcon
Instance: 18

 

but how can I get list contents of a class like that?

 

I was using AutoIT couple a months ago (but it was a ListView32 box) <-- was easy ;)

 

Thanks for any hints...

 

Rickey

 

P.S: I also checked the AutoIT Editors help pages (Keywords: "Qt5QWindowIcon" "Qt5Q", nut cant find nothing... Thanks!

Edited by nbg15

Share this post


Link to post
Share on other sites
nbg15

is QT of my clas the same "QT" like here?

http://www.qt.io/

 

or here;

 

 

Edited by nbg15

Share this post


Link to post
Share on other sites
alienclone

I also need some help with this window class. The new Mighty Text desktop app is Qt5QWindowIcon and I can only get SimpleSpy to setfocus to the main window. My experience with SimpleSpy and UIA is very minimal, this is what SimpleSpy gives me.

Mouse position is retrieved 148-185
At least we have an element [MightyText][Qt5QWindowIcon]

Having the following values for all properties: 
Title is: <MightyText>  Class   := <Qt5QWindowIcon> controltype:= <UIA_WindowControlTypeId> ,<50032>    , (0000C370)    57;-8;1317;784
*** Parent Information top down ***
0: Title is: <Desktop>  Class   := <#32769> controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    0;0;1366;768
"Title:=Desktop;controltype:=UIA_PaneControlTypeId;class:=#32769"   


;~ *** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_setVar("MightyText.mainwindow","title:=MightyText;classname:=Qt5QWindowIcon")
_UIA_action("MightyText.mainwindow","setfocus")


*** Detailed properties of the highlighted element ***
UIA_title:= <MightyText>
UIA_text:= <MightyText>
UIA_regexptitle:= <MightyText>
UIA_class:= <Qt5QWindowIcon>
UIA_regexpclass:= <Qt5QWindowIcon>
UIA_iaccessiblechildId:= <0>
UIA_handle:= <2495118>
UIA_RuntimeId:= <42;2495118>
UIA_BoundingRectangle:= <57;-8;1317;784>
; Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>

 


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah patience, how long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites
junkew

@NBG15: post simplespy output of your controls to give in indication if it can or cannot work

In general IUIAutomation supports accessibility of QT Widgets

However if the developers of your app are not nice to people with disabilities they forget to use the relevant QT Widget properties for accessbility. 

Check with a trial of Ranorex tooling but I think mightydesktop for sure is not behaving nice (I checked with NVDA and Simplespy and RanorexSpy and inpspect)

http://www.ranorex.com/blog/enabling-automation-for-custom-qt-widgets-by-adding-accessibility#trying

So all you can do is complain or sue the developers of mightydesktop not building accessible apps

 

edit: Its not about the QT class but about the QT Class properties developers are forgettng to give a value

edit2: Testcomplete seems to support more with injecting dlls into the qt application under test

https://support.smartbear.com/downloads/testcomplete/qt-modules/

Edited by junkew

Share this post


Link to post
Share on other sites
junkew

More interesting 

http://osxr.org:8080/qt/source/qtbase/src/plugins/platforms/windows/qtwindowsglobal.h

0198     case WM_GETOBJECT:
0199         return QtWindows::AccessibleObjectFromWindowRequest;
#include <APISysConstants.au3>
#include <GUIMenu.au3>
#include <WinAPIProc.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>
#include <array.au3>

Example()

Func Example()
    ; Retrieve a list of window handles using a regular expression. The regular expression looks for titles that contain the word SciTE or Internet Explorer.
    Local $aWinList = WinList("[REGEXPTITLE:Mighty.*]")
    $hWnd=$aWinlist[2][1]
    consolewrite($WM_GETOBJECT)
    consolewrite($hwnd)

    _ArrayDisplay($aWinList)
    $result = _SendMessage($hWnd, $WM_GETOBJECT, 0, 0)
    consolewrite($result)

EndFunc   ;==>Example

After trying above and setting the environment variable no result (ranorex, simplespy, inspect, au3inf) but looking thru QT source it should be able to work.

I am on windows 10 so maybe different results on other windows system

edit check source as below

http://osxr.org:8080/qt/source/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp

0052 #ifndef QT_NO_ACCESSIBILITY
0053 # include "accessible/qwindowsaccessibility.h"
0054 #endif
0797     case QtWindows::AccessibleObjectFromWindowRequest:
0798 #ifndef QT_NO_ACCESSIBILITY
0799         return QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(hwnd, wParam, lParam, result);
0800 #else
0801         return false;
0802 #endif
bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
0245 {
0246     if (static_cast<long>(lParam) == static_cast<long>(UiaRootObjectId)) {
0247         /* For UI Automation */
0248     } else if ((DWORD)lParam == DWORD(OBJID_CLIENT)) {
0249         // Start handling accessibility internally
0250         QGuiApplicationPrivate::platformIntegration()->accessibility()->setActive(true);
0251 #if 1
0252         // Ignoring all requests while starting up
0253         // ### Maybe QPA takes care of this???
0254         if (QCoreApplication::startingUp() || QCoreApplication::closingDown())
0255             return false;
0256 #endif
0257 
0258         typedef LRESULT (WINAPI *PtrLresultFromObject)(REFIID, WPARAM, LPUNKNOWN);
0259         static PtrLresultFromObject ptrLresultFromObject = 0;
0260         static bool oleaccChecked = false;
0261 
0262         if (!oleaccChecked) {
0263             oleaccChecked = true;
0264 #if !defined(Q_OS_WINCE)
0265             ptrLresultFromObject = (PtrLresultFromObject)QSystemLibrary::resolve(QLatin1String("oleacc"), "LresultFromObject");
0266 #endif
0267         }
0268 
0269         if (ptrLresultFromObject) {
0270             QWindow *window = QWindowsContext::instance()->findWindow(hwnd);
0271             if (window) {
0272                 QAccessibleInterface *acc = window->accessibleRoot();
0273                 if (acc) {
0274                     if (IAccessible *iface = wrap(acc)) {
0275                         *lResult = ptrLresultFromObject(IID_IAccessible, wParam, iface);  // ref == 2
0276                         if (*lResult) {
0277                             iface->Release(); // the client will release the object again, and then it will destroy itself
0278                         }
0279                         return true;
0280                     }
0281                 }
0282             }
0283         }
0284     }
0285     return false;
0286 }
Edited by junkew

Share this post


Link to post
Share on other sites
phuocvovan
On 2/22/2016 at 3:30 AM, junkew said:

Interesting direction to investigate

Use the QT_USE_NATIVE_WINDOWS=1 in your environment

It worked. But That Application is too lag. When i do something. i have to minimize it. And open it again

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

  • Similar Content

    • Pricehacker
      By Pricehacker
      Hello again!
      I have tried searching for quite some time now but couldn´t find a single working way to change the class of your GUI that doesn´t include changing it manually after its compilation.
      First or "AutoIt v3 GUI" is a pretty boring name tbh and i would like to spice it up a bit, also, and more importantly, I would like to identify my windows by something other than its title as it will change depending on some factors and im using two different programs independently as multi threading isn't supported.
      Any help is appreciated! Thank you!
    • bbProg
      By bbProg
      Hi,
       
      how can I wait activate for windows with information as in the photos attached?
      Class is not being recognized by the script.
       
      thanks in advanced.



    • rcmaehl
      By rcmaehl
      A UDF with Extended Functions for Window Management
       
      Notes:
      Fixes WinGetClassList's barbaric returning of a @LF separated string instead of an array.
       
      Potential Uses:
      Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
       
      Functions:
      _WinGetClassList
      _WinGetClassNNList
      _WindowGetHandleList
      _WindowGetHandleListFromPos
       
      Download: 
      WindowEx.zip  (v0.4)
       
      Changelog:
      10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x][1] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
      None reported To Do:
      To Be Decided. Opinions welcome! Upcoming Changes:
      To Be Decided.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning everyone

      I was playing a little bit with "Screen Capture" UDF, and I was trying to make a "Window" capture, but, since I made a GUI which through I fire the event "Capture", my GUI is captured as well, and I don't want to
      This is the line of code that makes the capture:
       
      _ScreenCapture_CaptureWnd($strScreenCaptureFileName, $objActiveWindow, 0, 0, -1, -1, False) And these are the lines of code which select the "active" window:
       
      Local $objCurrentWindow = 9999 If _IsPressed("01") Then $objCurrentWindow = WinGetHandle("[ACTIVE]") If $objCurrentWindow <> $objMyGUI Then $objActiveWindow = $objCurrentWindow EndIf EndIf Sorry If I made stupid mistakes
      Thanks in advance.

      Francesco
    • AdamUL
      By AdamUL
      Here is a function that will return a 2D array of visible windows.  You will notice that windows "Start" and "Program Manager"  windows will always be in the array.  The array returns the title of the window, the window handle, the PID of the process associated with the window, the process name associated with the window, the window's position, and the window's dimension,  Please see comments in the code about the numbers returned about the window's position.
       
      #include <Array.au3> #include <Process.au3> ;Get a list of visable windows with titles. $aWindows = _GetVisibleWindows() _ArrayDisplay($aWindows) Func _GetVisibleWindows() ;Retrieve a list of windows. Local $aWinList = WinList() If Not IsArray($aWinList) Then Return SetError(0, 0, 0) ;Loop through the array deleting no title or invisable windows. Local $sDeleteRows = "" For $i = 1 To $aWinList[0][0] If $aWinList[$i][0] = "" Or Not BitAND(WinGetState($aWinList[$i][1]), $WIN_STATE_VISIBLE) Then $sDeleteRows &= $i & ";" EndIf Next $sDeleteRows = StringTrimRight($sDeleteRows, 1) ;Remove last ";". _ArrayDelete($aWinList, $sDeleteRows) $aWinList[0][0] = UBound($aWinList) - 1 ;Get Window's Processor ID (PID), and add to the array. _ArrayColInsert($aWinList, UBound($aWinList, 2)) For $i = 1 To $aWinList[0][0] $aWinList[$i][2] = WinGetProcess($aWinList[$i][1]) Next ;Get Window's Process Name from PID, and add to the array. _ArrayColInsert($aWinList, UBound($aWinList, 2)) For $i = 1 To $aWinList[0][0] $aWinList[$i][3] = _ProcessGetName($aWinList[$i][2]) Next ;Get Windows's Position and Size, and add it to the array. ;For Position, -3200,-3200 is minimized window, -8,-8 is maximized window on 1st display, and ;x,-8 is maximized windown on the nth display were x is the nth display width plus -8 (W + -8). _ArrayColInsert($aWinList, UBound($aWinList, 2)) ;Position (X,Y). _ArrayColInsert($aWinList, UBound($aWinList, 2)) ;Dimension (WxH). Local $aWinPosSize For $i = 1 To $aWinList[0][0] $aWinPosSize = WinGetPos($aWinList[$i][1]) $aWinList[$i][4] = $aWinPosSize[0] & "," & $aWinPosSize[1] $aWinList[$i][5] = $aWinPosSize[2] & "x" & $aWinPosSize[3] Next Return $aWinList EndFunc ;==>_GetVisibleWindows  
      Adam
       
×