java - JNA Win32 Get the title of JInternalFrame -
i´l dealing jna , trying title of jinternalframe inside jdialog. can windows programns titles using jna, jinternalframe´s title not apear in list.
i´m doing 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, jinternalframes not, me?
actually, i'll more specific. i'm using jna because i'm trying focus on program that's running on production. don't have access application production code , neither access install nothing on machine. can call own jar programs. program robot fills forms that's inside particular jinternalframe. reason, frame lost focus after actionperformed button event and, i'd set focus again on frame using program continue filling process. can performing click on location of jinternalframe, it's little risk because if miss click inside frame program ciuld fill wrong form. so, there way set focus on jinternalframe of third-party application using jna + jrobot or access dark side force of jvm, :)? can set focus jdialog, not it's internal frame.
swing non-top level components light weight components, not created operating system, not have hwnd window handle, , cannot obtained via jna. instead have go through jvm such calling getallframes() on jdesktoppane holds jinternalframes of interest.
Comments
Post a Comment