Sign in to follow this  
Followers 0
dbzfanatic

Reading from java app.

2 posts in this topic

I have a java program that has a file list and I need a way to read those files. As of now my idea is to open the location in IE, Read the body text, and see if the filename is in the returned string. Is there a way to do this direcly in the java app? Normally I'd just use the control functions but this is all that's returned from the Window Info tool.

>>>> Window <<<<

Title: DAV Explorer

Class: SunAwtFrame

Position: 0, 0

Size: 1018, 578

Style: 0x16CF0000

ExStyle: 0x00000100

Handle: 0x001E1428

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

Advanced (Class):

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle: 0x001D0D94

>>>> Mouse <<<<

Position: 522, 356

Cursor ID: 2

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> Visible Text <<<<

>>>> Hidden Text <<<<

Is there a way to get the file list directly from the java app?

Share this post


Link to post
Share on other sites



I have a java program that has a file list and I need a way to read those files. As of now my idea is to open the location in IE, Read the body text, and see if the filename is in the returned string. Is there a way to do this direcly in the java app? Normally I'd just use the control functions but this is all that's returned from the Window Info tool.

Is there a way to get the file list directly from the java app?

There was a post back in '07 that may help you; while Au3Info may not be able to return the controls from your individual window, the following information may:

I have found another solution though, which seems like it might work....

By using Java Ferret (Java's version of Auto-It's Window Info program) I can get the handles and classnames to call

by installing the Java Access Bridge and its incorporated dll, windowsaccessbridge.dll, I should be able to use a DllCall() to the Dll and then select menus through this. This would be a much smarter approach.

The following code is something I'm trying to get working. By using an example Java Swing program, I tried to find the controls in it using the Java Ferret.

Now I know my call to the command prompt ain't the cleanest, but I don't care about it for the moment, I really wasn't bothereb being perfect about it, I can clean that later.

Run("cmd.exe")
WinWaitActive("C:\WINDOWS\system32\cmd.exe")
Send( "cd \Progra~1\Java\jdk1.6.0_02\bin{ENTER}")
Send( "java JMenuDemo{ENTER}")

; Wait for the JMenu Usage Demo to become active - it is titled "JMenu Usage Demo" on English systems
WinWaitActive("JMenu Usage Demo")

WinActivate ( "JMenu Usage Demo" )
AutoItSetOption("SendKeyDelay", 400)

$dll = DllOpen("windowsaccessbridge.dll")
$hwnd = ControlClick("[Class:SunAWTFrame]", "&Menu 1", "", "left", 1)
$menu = ControlClick("[Class:SunAWTFrame]", "Menu Item with PlainText", "","left", 1)

ControlFocus("[Class:SunAWTFrame]","JMenu Usage Demo")
DllCall($dll, "void", "Windows_run")
DllCall($dll, "void", "AccessBridge_FocusGainedFP", "hwnd", $hwnd)
DllCall($dll, "void", "setMouseClickedFP(MouseClickedDelegate fp)")
It's not exactly what you are looking for, but should point you in the proper direction. While Au3Info may not return the results for you, that Java Ferrett program may return the proper &ControlID's for you to work with, and scrape the information you need w/ the various Control* functions in Autoit.

The code example was just what 'MadMike' was working on, not really relevant to what you are doing, but, you can at least see his train of thought.

The exact topic is located at: http://www.autoitscript.com/forum/index.php?showtopic=52853


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
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
Sign in to follow this  
Followers 0