SreeJayakumar Posted March 20, 2014 Posted March 20, 2014 (edited) Hi, I am using AutoItx3.dll with Java. But while using Au3_Controlgettext i am getting a JVM crash. Code is as below: public void AU3_ControlGetText(WString szTitle, WString szText, WString szControl,byte [] szControlText, int nBufSize); autoitx.INSTANCE.AU3_ControlGetText( szTitle, szText, szControl,szControlText,nBufSize); usage: byte[] controltext = new byte[1024]; autoitx.INSTANCE.AU3_ControlGetText( Title,Text,new WString("[CLASS:Edit;INSTANCE:52]"),controltext,1024); can someone help me on this? Edited March 20, 2014 by SreejaJayakumar
wangzhengbo Posted March 21, 2014 Posted March 21, 2014 You can use JAutoItX, download it from http://code.google.com/p/jautoitx/downloads/list
wangzhengbo Posted March 21, 2014 Posted March 21, 2014 Hi, I am using AutoItx3.dll with Java. But while using Au3_Controlgettext i am getting a JVM crash. Code is as below: public void AU3_ControlGetText(WString szTitle, WString szText, WString szControl,byte [] szControlText, int nBufSize); autoitx.INSTANCE.AU3_ControlGetText( szTitle, szText, szControl,szControlText,nBufSize); usage: byte[] controltext = new byte[1024]; autoitx.INSTANCE.AU3_ControlGetText( Title,Text,new WString("[CLASS:Edit;INSTANCE:52]"),controltext,1024); can someone help me on this? /** * Retrieves text from a control. * * When using a control name in the Control functions, you need to add a * number to the end of the name to indicate which control. For example, if * there two controls listed called "MDIClient", you would refer to these as * "MDIClient1" and "MDIClient2". * * @param title * The title of the window to access. * @param text * The text of the window to access. * @param controlId * The control to interact with. * @return Returns text from a control if success, returns null if failed. */ public static String getText(final String title, final String text, final String controlId) { final int bufSize = CONTROL_GET_TEXT_BUF_ZIZE; final CharBuffer controlText = CharBuffer.allocate(bufSize); getAutoItX() .AU3_ControlGetText(stringToWString(defaultString(title)), stringToWString(text), stringToWString(defaultString(controlId)), controlText, bufSize); return hasError() ? Win32.getControlText(Control.getHandle_(title, text, controlId)) : Native.toString(controlText.array()); }
ManojThennarasu Posted March 26, 2014 Posted March 26, 2014 Am Also facing the same prob while using ControlGetText command.. can anyone help us on this....
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