jna - How to get list of List all child controls (Handles) of a given window by using java -
i want child handles of parent window. can done in autoit script but, want in java , command unavailable in autoitx4java.jar. started create it, , took example of calculator:
public static hwnd getwindow( windef.hwnd hwnd, windef.dword ucmd) { user32 user32 = (user32) native.loadlibrary("user32", user32.class); return user32.getwindow(hwnd, ucmd); } public static void main(string[] args) { windef.hwnd hwnd = user32.instance.findwindow("calcframe", "calculator"); windef.dword = new windef.dword(5); // child 5 system.out.println("parent : " + hwnd); windef.hwnd hwnd3 = getwindow ( hwnd , ); system.out.println("child " + hwnd3); windef.dword b = new windef.dword(2); // next 2 windef.hwnd hwnd2= getwindow ( hwnd3 , b ); system.out.println(hwnd2); int x = 0; while (hwnd2 != null ) { x++; system.out.println(hwnd2); hwnd2= getwindow ( hwnd , b ); if (x>30) break; } }
this code not working , throwing errors.
output:
parent : native@0x180d78
child native@0x4400f8
null
does not find sibling controls.
Comments
Post a Comment