kalzanth Posted December 24, 2009 Share Posted December 24, 2009 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 More sharing options...
PsaltyDS Posted December 27, 2009 Share Posted December 27, 2009 $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 More sharing options...
kalzanth Posted January 1, 2010 Author Share Posted January 1, 2010 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 More sharing options...
ChrisL Posted January 1, 2010 Share Posted January 1, 2010 Replace windowTitle with the title of the window $var = ControlGetText ("WindowTitle", "", "Static8") [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
z0mgItsJohn Posted January 1, 2010 Share Posted January 1, 2010 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 More sharing options...
PsaltyDS Posted January 2, 2010 Share Posted January 2, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now