Jump to content

Help with Controls


kalzanth
 Share

Recommended Posts

Hi I'm having some trouble using this command, I'm new at this and have searched the forums and checked the help files, but still can't get it to work.

$var = ControlGetText ( "[CLASS:#32770", "", 1814 )
MsgBox ( 1, "", $var )

The text I'm trying to read is the resolution size under display properties in this example.

Using AU3 Info tool

"[CLASS:#32770]" - from Class under Basic Window Info

1814 - from ID under Control Tab.

I've been trying different things for awhile now, what am I doing wrong?

Thanks

Link to comment
Share on other sites

$var = ControlGetText ( "[CLASS:#32770", "", 1814 )
MsgBox ( 1, "", $var )
Did you really leave the closing square bracket off? Even if you didn't, that is a very common class and there may be more than one, so a more specific advanced title for the window would be better.

What was the class of the control? If it's something like "SysListView32", then there are more steps required to read it.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Did you really leave the closing square bracket off? Even if you didn't, that is a very common class and there may be more than one, so a more specific advanced title for the window would be better.

What was the class of the control? If it's something like "SysListView32", then there are more steps required to read it.

;)

No the closing bracket wouldn't have been left off, just a bad copy paste.

But I might be totally misunderstanding how this command is used too. This is my first time trying to get any of the control commands to work. Essentially what I'm trying to do is create a script that sets the screen resolution to a specific size. The way I'm going about trying to do this is to have it be able to read from the display properties window and then adjust the slider left or right to the size I want. Right now I'm just trying to get it to read the text in this window.

Using the window info tool gives me this information.

>>>> Control <<<<

Class: Static

Instance: 8

ClassnameNN: Static8

Advanced (Class): [CLASS:Static; INSTANCE:8]

ID: 1814

Text: 1920 by 1200 pixels

Position: 31, 286

Size: 150, 16

ControlClick Coords: 100, 7

Style: 0x50000001

ExStyle: 0x00000004

Handle: 0x00010272

$var = ControlGetText ("[CLASS:Static]", "", "Static8")

This always returns a blank result.

Link to comment
Share on other sites

I'm guessing your trying to get this information from the "Display Properties -> Settings" this will get the job done.

$var = ControlGetText ('Display Properties','','Static8')
ConsoleWrite ('$Var : ' & $var & @CRLF)

The console out puts "$Var : 1024 by 768 pixels" for me so it should work for you. ;]

- John

Latest Projects :- New & Improved TCP Chat

Link to comment
Share on other sites

You can probably figure out the GUI interface, but what you really want is to make a DllCall() to ChangeDisplaySettings or ChangeDisplaySettingsEx. Search the forum for those function names to see many examples of usage.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...