Package com.install4j.api.windows
Class WindowInfo
java.lang.Object
com.install4j.api.windows.WindowInfo
Collection of methods to retrieve information about windows
on Microsoft Windows.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the window class name.longgetHwnd()Returns the window handle.intgetStyle()Returns the window style.static Collection<WindowInfo> getTopLevelWindows(long processId) Returns all visible top level windows of the process with the supplied process id.Returns the window title.static booleanChecks if Windows 10 is currently used in tablet mode.toString()static booleanwaitForMaximizableWindow(File executablePath, long timeout, TimeUnit unit) Wait until a process with the given path displays a maximizable window.
-
Method Details
-
getTopLevelWindows
Returns all visible top level windows of the process with the supplied process id.- Parameters:
processId- the process id- Returns:
- the top level windows or an empty list if the process does not exist.
-
isTabletMode
public static boolean isTabletMode()Checks if Windows 10 is currently used in tablet mode.- Returns:
trueif tablet mode is activated
-
waitForMaximizableWindow
Wait until a process with the given path displays a maximizable window. When Windows is in tablet mode, you can use this method to delay the termination of an update downloader until a subsequently started installer can be displayed in full-screen mode.- Parameters:
executablePath- the executable pathtimeout- a timeout value or 0 if no timeout should occurunit- the unit of the timeout value- Returns:
trueif a process with the given executable path was found that displays a maximizable window within the timeout period,falseotherwise.
-
getHwnd
public long getHwnd()Returns the window handle.- Returns:
- the window handle
-
getStyle
public int getStyle()Returns the window style. This is the style int retrieved withGetWindowLongPtrandGWL_STYLE.- Returns:
- the style
-
getClassName
Returns the window class name.- Returns:
- the class name
-
getWindowTitle
Returns the window title.- Returns:
- the title
-
toString
-