bobthebuilder Posted December 12, 2005 Share Posted December 12, 2005 I have a dialog box with a string i need to read which is held in a static text box (i think) inside the dialog. I was hoping the autoit window info tool would diplay the name of the control which holds the string, but it does not - so how do i read the text string. Regs, Bob. Link to comment Share on other sites More sharing options...
seandisanti Posted December 12, 2005 Share Posted December 12, 2005 I have a dialog box with a string i need to read which is held in a static text box (i think) inside the dialog.I was hoping the autoit window info tool would diplay the name of the control which holds the string, butit does not - so how do i read the text string.Regs,Bob.does the window info tool display the text you're tryign to grab anywhere? window text, control text etc? Link to comment Share on other sites More sharing options...
Josbe Posted December 12, 2005 Share Posted December 12, 2005 I have a dialog box with a string i need to read which is held in a static text box (i think) inside the dialog. I was hoping the autoit window info tool would diplay the name of the control which holds the string, but it does not - so how do i read the text string. Regs, Bob. Try (with msgbox displayed): $sTitle = "here the msgbox title";win title If WinExists( $sTitle ) Then $sText = ControlGetText( $sTitle, '', "Static1") Msgbox(0, "Text copied", "Text captured from the msgbox: '" & $sTitle & "'" & @LF & '"' & $sText & '"' ) Else Msgbox(0, "Error", "window: " & $sTitle & " doesn't exists." ) EndIf AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
herewasplato Posted December 12, 2005 Share Posted December 12, 2005 (edited) If you cannot find it in the window info tool - then look at PixelChecksum. If you are looking for a phrase to be present or not, then you might be able to PixelChecksum the entire area where the phrase shows up. If you must read each character, then search the forum for OCR. Edit2 - I found my answer to Edit1 Edited December 14, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
bobthebuilder Posted December 12, 2005 Author Share Posted December 12, 2005 does the window info tool display the text you're tryign to grab anywhere? window text, control text etc?No sign of the desired text anywhere, although i do get the correct window name and info about the okbutton.This is the code used to create the box in c++, i need to cpture the cption from the class,is there a mechanism for obtaining the class used to derive a window and accesing it membersusing its handle?_fastcall Tform_RigErrorMessageBox::Tform_RigErrorMessageBox( TComponent* Owner, String caption, String message) : TForm(Owner), selfDelete(false){ message += "\n"; this->Caption = caption; int captionWidth = 1.15 * this->Canvas->TextWidth(caption); int initialTextWidth = label_Message->Width; int initialTextHeight = label_Message->Height; label_Message->Caption = message; int currentTextWidth = label_Message->Width; int currentTextHeight = label_Message->Height; //Is message text width larger than default? int textWidthDifference = currentTextWidth - initialTextWidth; //Is caption width larger than message text width and default? if (captionWidth > initialTextWidth && captionWidth > currentTextWidth) { textWidthDifference = captionWidth - initialTextWidth; label_Message->Width = captionWidth; } //Does caption and message text fit in window? if (textWidthDifference > 0) { this->Width = this->Width + textWidthDifference; } int textHeightDifference = currentTextHeight - initialTextHeight; if (textHeightDifference > 0) { this->Height = this->Height + textHeightDifference; button_OK->Top = button_OK->Top + textHeightDifference; } button_OK->Left = (this->Width) / 2 - (button_OK->Width) / 2 - 5;}regs,Bob 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