KarlosTHG Posted May 30, 2009 Posted May 30, 2009 Hi guys, i'm trying to get the text of a window to parse this and get some parts but when it has more 32kb of text, cannot get the entire text, what can i do? sorry for my english
Xenobiologist Posted May 30, 2009 Posted May 30, 2009 Hi, what function do you use? Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
MrCreatoR Posted May 30, 2009 Posted May 30, 2009 (edited) Indeed, WinGetText() has a limit of 32 kb, not 64 as remarked in the help file: #include <GUIConstantsEx.au3> #include <EditConstants.au3> ; $GUI = GUICreate("Test Script", 300, 200) $nEdit = GUICtrlCreateEdit("", 20, 40, 260, 120) GUICtrlSendMsg($nEdit, $EM_LIMITTEXT, -1, 0) ;This one will remove the text limit in Edit control $sData = "" For $i = 1 To (32 * 1024) + 100 ;32768 + 100 = 32868 $sData &= "a" Next GUICtrlSetData($nEdit, $sData) GUISetState(@SW_SHOW, $GUI) $sWinGetText_Data = WinGetText($GUI) $sControlGetText_Data = ControlGetText($GUI, "", "Edit1") $sGUICtrlRead_Data = GUICtrlRead($nEdit) MsgBox(48, "*GetText Test", _ StringFormat("WinGetText()\t\t= %i -> Limited up to 32kb? (32 * 1024 = 32768)\nControlGetText()\t\t= %i\nGUICtrlRead()\t\t= %i", _ StringLen($sWinGetText_Data), StringLen($sControlGetText_Data), StringLen($sGUICtrlRead_Data))) Or it's a wrong check? Edited May 30, 2009 by MrCreatoR Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
trancexx Posted May 31, 2009 Posted May 31, 2009 It's about unicode, so 64KB is ok to say. Interesting thing is that the limit is set not with used function SendMessageW(WM_GETTEXT) but later on. Buffer is filled fully for every control and truncated afterwards. ♡♡♡ . eMyvnE
KarlosTHG Posted June 1, 2009 Author Posted June 1, 2009 hi again, thanks for your interest but nobody has an idea to bypass this problem, this is an example for understand me better: i load a program this program has a control (edit, label) this control has so many text, over 100k i need to get that text in my script and parse it to get some parts autoit get the text but only 32k and the other text is missing maybe with APIs or a dll someone has an idea
KarlosTHG Posted June 1, 2009 Author Posted June 1, 2009 yes im sorry but this pc is behind a proxy and that proxy show me and error and i think the message was not send
martin Posted June 1, 2009 Posted June 1, 2009 yes im sorry but this pc is behind a proxy and that proxy show me and error and i think the message was not sendMaybe you could use the message EM_GETLINECOUNTand then get every line in a loop using EM_GETLINE. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
KarlosTHG Posted June 1, 2009 Author Posted June 1, 2009 Maybe you could use the message EM_GETLINECOUNTand then get every line in a loop using EM_GETLINE.ok, i will to test it, thanks
martin Posted June 1, 2009 Posted June 1, 2009 (edited) ok, i will to test it, thanks I think it will work. I had a quick play like this, (apologioes for messy script modified from MrCreatoR's, but I'm off to bed!) expandcollapse popup#include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <SendMessage.au3> ; $GUI = GUICreate("Test Script", 300, 200) $nEdit = GUICtrlCreateEdit("", 20, 40, 260, 120) GUICtrlSendMsg($nEdit, $EM_LIMITTEXT, -1, 0);This one will remove the text limit in Edit control $sData = "" For $i = 1 To 33 for $j = 1 to 1023;(32 * 1024) + 100;32768 + 100 = 32868 $sData &= "a" Next $sData &= @CRLF Next GUICtrlSetData($nEdit, $sData) GUISetState(@SW_SHOW, $GUI) $sWinGetText_Data = WinGetText($GUI) $sControlGetText_Data = ControlGetText($GUI, "", "Edit1") $sGUICtrlRead_Data = GUICtrlRead($nEdit) MsgBox(48, "*GetText Test", _ StringFormat("WinGetText()\t\t= %i -> Limited up to 32kb? (32 * 1024 = 32768)\nControlGetText()\t\t= %i\nGUICtrlRead()\t\t= %i", _ StringLen($sWinGetText_Data), StringLen($sControlGetText_Data), StringLen($sGUICtrlRead_Data))) $LInes = _SEndmessage(controlgethandle($gui,"",$nEdit),$EM_GETLINECOUNT) ConsoleWrite($lines & @CRLF) $sbuf = DllStructCreate("char[3000]");set to some length more than expected line length $sTC = dllstructcreate("wchar",DllStructGetPtr($sBuf)) dllstructsetdata($sTC,1,3000) $chars = _SendMessage(controlgethandle($gui,"",$nEdit),$EM_GETLINE,32,dllstructgetptr($sbuf));read line 33 ConsoleWrite($chars & @CRLF);the no of chars returned ConsoleWrite(Dllstructgetdata($sBuf,1) & @CRLF);the line read EDIT: This is not needed due to my misunderstanding of MrCreatoR's example above (post #3), so it is better to use ControlGetText. Edited June 2, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
MrCreatoR Posted June 2, 2009 Posted June 2, 2009 hi again, thanks for your interest but nobody has an idea to bypass this problem, this is an example for understand me better:i load a programthis program has a control (edit, label)this control has so many text, over 100ki need to get that text in my script and parse it to get some partsautoit get the text but only 32k and the other text is missingmaybe with APIs or a dllsomeone has an ideaBut what about ControlGetText(), it's has no limit as far as i tested (with 100 kb as well)... Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
martin Posted June 2, 2009 Posted June 2, 2009 But what about ControlGetText(), it's has no limit as far as i tested (with 100 kb as well)...Oh, I thought your script was showing that the same limit applied. In that case ignore my post. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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