Package com.install4j.api.windows
Class WindowInfo
- java.lang.Object
-
- com.install4j.api.windows.WindowInfo
-
public class WindowInfo extends java.lang.Object
Collection of methods to retrieve information about windows on Microsoft Windows.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getClassName()
Returns the window class name.long
getHwnd()
Returns the window handle.int
getStyle()
Returns the window style.static java.util.Collection<WindowInfo>
getTopLevelWindows(long processId)
Returns all visible top level windows of the process with the supplied process id.java.lang.String
getWindowTitle()
Returns the window title.static boolean
isTabletMode()
Checks if Windows 10 is currently used in tablet mode.java.lang.String
toString()
static boolean
waitForMaximizableWindow(java.io.File executablePath, long timeout, java.util.concurrent.TimeUnit unit)
Wait until a process with the given path displays a maximizable window.
-
-
-
Method Detail
-
getTopLevelWindows
public static java.util.Collection<WindowInfo> getTopLevelWindows(long processId)
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:
true
if tablet mode is activated
-
waitForMaximizableWindow
public static boolean waitForMaximizableWindow(java.io.File executablePath, long timeout, java.util.concurrent.TimeUnit unit)
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 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:
true
if a process with the given executable path was found that displays a maximizable window within the timeout period,false
otherwise.
-
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 withGetWindowLongPtr
andGWL_STYLE
.- Returns:
- the style
-
getClassName
public java.lang.String getClassName()
Returns the window class name.- Returns:
- the class name
-
getWindowTitle
public java.lang.String getWindowTitle()
Returns the window title.- Returns:
- the title
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-