public static Set<Window> getAllWindows() {
		Set<Window> set = new HashSet<>();
		Frame sharedOwnerFrame = (Frame) AppContext.getAppContext()
				.get(new StringBuffer("SwingUtilities.sharedOwnerFrame"));
		if (sharedOwnerFrame != null) {
			set.addAll(getAllWindows(sharedOwnerFrame));
		}

		for (Frame frame : Frame.getFrames()) {
			set.addAll(getAllWindows(frame));
		}

		Window[] windows = Window.getWindows();
		for (Window window : windows) {
			set.add(window);
		}

		return set;
	}
Gets all windows in the system (including Frames).

@return all windows
Ghidra/Framework/Gui/src/main/java/generic/test/AbstractGuiTest.java