Jump to content

Controlgettext()


shaqan
 Share

Recommended Posts

I have checked the Help over and over but the damned thing simply does not work for me.

in Help

ControlGetText ( "title", "text", controlID )

Sample states

ControlGetText("[CLASS:Notepad]", "", "Edit1")

But when I try to use

ControlGetText("[CLASS:ProFrame]", "Piiriületus","ComboBox16")

all I get is an empty error.. And even this I know only because of "If @error Then" statement I added..

Au3Info window

Posted Image

Could you please clarify the exact meaning of

"The title of the window to access."

and

"The text of the window to access."

Why is [CLASS:whatever] used instead of title with the first one..?

And what exactly should be for the second.. the sentence is pretty much fog for me though I understand each and every word in it. Maybe my English simply sucks (3rd language)..

I tried to find examples from the ready scripts in forum but Search turned up very vague results..

Thank you in advance :)

Weird part of it is, I have used ControlGetText before, with other programs and it has worked well.. It's acting weird only with this one. Figured I'm making some fundamental mistake somewhere..

Edited by shaqan
Link to comment
Share on other sites

What happens when you don't use "Piiriületus" and just use "" for the text of the window instead?

The title can be either the window title, or one of several alternate items that can be used in place of it.

From the help file:

Advanced Window Descriptions

A special description can be used as the window title parameter. This description can be used to identify a window by the following properties:

  • TITLE - Window title
  • CLASS - The internal window classname
  • REGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)
  • REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)
  • LAST - Last window used in a previous AutoIt command
  • ACTIVE - Currently active window
  • X \ Y \ W \ H - The position and size of a window
  • INSTANCE - The 1-based instance when all given properties match
The text portion can usually be left blank unless you're looking for a specific window and there is more than one of the same window open that would match the title.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

What happens when you don't use "Piiriületus" and just use "" for the text of the window instead?

The result would be "Piiriületus" (which is actually the title of the window and should'nt be the result If I figure things accurately)

.. instead of text displayed inside control (what would be the data I am after)

Edited by shaqan
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...