Results 1 to 4 of 4

Thread: Getting QLabel to work with WinAPI GetWindowText?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Getting QLabel to work with WinAPI GetWindowText?

    The test script is a separate process. In order to have access to the QWidget-specific calls, I would need a way to convert the hwnd obtained through the WinAPI into a QWidget object. If there is a way to do this, I would be ecstatic.

    From outside the running Qt app, I get the hwnd to the app through the EnumWindows WinAPI call, then feed this into EnumChildWindows to iterate through all the QWidgets in the app.

    With the control's hwnd in hand, I can get things like the Windows class name (QWidget), as well as simulate user actions by sending windows messages like WM_LBUTTONDOWN / WM_LBUTTONUP.

    What I'm having trouble with is getting data out of the control. Froglogic has a testing program called Squish with a spy feature than can attach to a running app and explore the entire control tree / properties etc. All I really need is the control text.

    Any help appreciated,

    Michael

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Getting QLabel to work with WinAPI GetWindowText?

    Squish uses Qt API to do the job, the only platform specific thing is the attachment to the AUT itself, at least I think so

Similar Threads

  1. QScrollArea display custom QLabel
    By spawnwj in forum Qt Programming
    Replies: 6
    Last Post: 6th December 2006, 03:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.