!7 !include once #1030303 // JNA Win32 p { User32.INSTANCE.EnumWindows(new WNDENUMPROC { int count = 0; @Override public boolean callback(HWND hWnd, Pointer arg1) { char[] windowText = new[512]; User32.INSTANCE.GetWindowText(hWnd, windowText, windowText.length); new RECT rect; User32.INSTANCE.GetWindowRect(hWnd, rect); S wText = Native.toString(windowText); // get rid of this if block if you want all windows regardless of whether // or not they have text if (wText.isEmpty()) { return true; } print("Found window with text " + hWnd + ", total " + ++count + " Text: " + wText + ", rect: " + rect); return true; } }, null); print("done"); }