Sign in to follow this  
Followers 0
trandatnh

How to write a function like WinGetText in C/C++

7 posts in this topic

hi all,

I found that the funtion WinGetText can get "visible text". But I wonder if we can write the same function in C...

thanks :)

Share this post


Link to post
Share on other sites



trandatnh,

I am sure that you can - but as this is a forum for AutoIt-related questions, I suggest you ask on a C forum instead. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Moved. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Get a list of all controls on the window and read their text. Smush it together. Viola.

Share this post


Link to post
Share on other sites

@Richard Robertson,

yes I have the same idea. Thanks :)

then do you have any ideas to get all the controls of the current activated windows, I mean it would be written on C/C++ only.

Share this post


Link to post
Share on other sites

EnumChildWindows.

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  
Followers 0

  • Similar Content

    • Chromed
      By Chromed
      If I wanted to repeatedly check only the last line from the results of a WinGetText to trigger a word match via StringRegExp what would be the code/pattern for that? 
    • Sn3akyP3t3
      By Sn3akyP3t3
      Breevy is a text expander tool that is a handy productivity tool. However, it can interfere with Send commands to some windows if it is enabled and has the Typo AutoCorrections library imported and the utility is enabled. I seek to determine programmatically what the status of Breevy is either Enabled or Disabled.

      Via the GUI the utility presents the status as "Enabled" or "Disabled".

      This was my script to test with:
      ;With Breevy running and minimized
      If WinExists('Breevy') Then
      Opt('WinDetectHiddenText', 1)
      $hBreevy = WinGetHandle('Breevy')
      MsgBox(0,"",WinGetText($
      hBreevy))
      EndIf

      Results:
      Breevy.exe

      Summary of AutoIt v3 Window Info tool:
      >>>> Window <<<<
      Title: Breevy (Portable Mode)
      Class: gdkWindowToplevel
      Position: -8, -8
      Size: 1296, 1010
      Style: 0x17CF0000
      ExStyle: 0x00000110
      Handle: 0x00000000001309DE

      >>>> Control <<<<
      Class:
      Instance:
      ClassnameNN:
      Name:
      Advanced (Class):
      ID:
      Text:
      Position:
      Size:
      ControlClick Coords:
      Style:
      ExStyle:
      Handle:

      >>>> Mouse <<<<
      Position: 592, 10
      Cursor ID: 0
      Color: 0xC7D5E3

      >>>> StatusBar <<<<

      >>>> ToolsBar <<<<

      >>>> Visible Text <<<<
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe
      Breevy.exe


      >>>> Hidden Text <<<<
      Breevy.exe

      Any tips or suggestions will be appreciated. Also, is what I'm seeking to achieve feasible via viewing text of the window when minimized to the task bar in the tray?