I´l dealing with JNA and trying to get the title of a JInternalFrame that is inside a JDialog. I can get all the Windows Programns Titles by using JNA, but the JInternalFrame´s title does not apear in the list.
I´m doing something like this:
user32.EnumWindows(new User32.WNDENUMPROC() {
int count;
public boolean callback(HWND hWnd, Pointer userData) {
char[] windowText = new char[1024*2];
EnumerateWindows.User32DLL.GetWindowTextW(hWnd, windowText,
EnumerateWindows.getMaxTitleLength());
String wText = Native.toString(windowText);
wText = (wText.isEmpty()) ? "" : " " + wText;
if (!wText.isEmpty())
logger.warn("Window Title:"
+ wText);
return true;
}
}, null);
...
All Windows Titles appear, but the JInternalFrames does not, somebody could help me?
Actually, I'll be more specific. I'm using JNA because I'm trying to get focus on a program that's running on production. I don't have access to the application production code and neither access to install nothing on this machine. I just can call my own jar programs. My program is a robot that fills some forms that's inside this particular JInternalFrame. For some reason, this frame lost focus after an ActionPerformed button event and, I'd like to set the focus again on this frame using my program to continue filling process. I can do this by performing a click on any location of the JInternalFrame, but it's a little risk because if i miss click inside the frame my program ciuld fill the wrong form. So, is there a way to set focus on a JInternalFrame of a third-party application using JNA + JRobot or access some dark side force of the JVM, :)? I can set focus to the JDialog, but not to it's internal frame. Thanks