0

Usually, my AHK program reads the content of the "Filename:" text zone in file dialog boxes (Open, Save As, etc.) using the following info: read the content of control "Edit1" in dialog box of class "#32770". It can also read the list of controls using this piece of code:

; in Notepad, open the "Open" dialog box
WinGet, strControlsList1, ControlList, ahk_class #32770
WinGetTitle, strTitle1, ahk_class #32770
MsgBox, , %strTitle1% controls, %strControlsList1%

I'm trying to do the same in Java programs implemented for Windows (PDF Split and Merge and Geogebra) using Java Access Bridge, I guess. I know that these programs use the class name "SunAwtDialog" instead of the usual "#32770" for their dialog boxes. But I can't get access to the "Filename" control name. "Edit1" does not work. And I can't get the list of controls in this dialog box using this code:

; in a Java app like PDF Split and Merge, open the "Save As" dialog box
WinGet, strControlsList2, ControlList, ahk_class SunAwtDialog
WinGetTitle, strTitle2, ahk_class SunAwtDialog
MsgBox, , %strTitle2% controls, %strControlsList2%

Any idea how an AHK script could get info from these Java apps dialog boxes?

JnLlnd
  • 165
  • 1
  • 14
  • 4
    If the dialogs are swing or javafx based, then you may find that this won't work, as the controls don't actually have a native peer/windows handel, they are implemented native within the API it self. – MadProgrammer Oct 09 '15 at 22:47
  • That's probably the reason why controls are not visible. Thanks MadProgrammer. – JnLlnd Oct 09 '15 at 22:53
  • 1
    MadProgrammer nailed it. Found this snippet from @PhiLho ... most Java dialogs respect the Tab navigation between controls, maybe you can go this way. Well programmed applications associate a shortcut key to controls, but that's a convention that even native (Win32) application programmers forget, and WinXP's default policy of hidding these shortcuts (marked in program with &, shown with underlined chars) will probably not help in propagating this usage. Worth a shot? – errorseven Oct 09 '15 at 22:54
  • @ahkcoder: Using [Tab] would be a good idea if it was for only one program. But my app (www.quickaccesspopup.com) would have to work with any app having dialog box class SunAwtDialog. And shortcut, if present, may differ from one app to the other. I guess I'll have to give up for this family of apps. – JnLlnd Oct 10 '15 at 02:56
  • You could try AutoHotkey's AccViewer just in case it works, to see what information can be retrieved from the 'controls', it's always the first thing I try. – vafylec Jan 02 '17 at 02:28
  • Possible duplicate of [How do I automate a Java application with AutoHotkey?](https://stackoverflow.com/q/17564086/3357935) – Stevoisiak Oct 13 '17 at 18:51

0 Answers0