public class WindowUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
HWND_BOTTOM |
static int |
HWND_NOTOPMOST |
static int |
HWND_TOP |
static int |
HWND_TOPMOST |
static int |
LWA_ALPHA |
static int |
LWA_COLORKEY |
static int |
SWP_NOMOVE |
static int |
SWP_NOSIZE |
static int |
WS_EX_LAYERED |
Constructor and Description |
---|
WindowUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
BringWindowToTop(int hWnd)
Bring target Window to top
|
static int |
FindWindow(String windowClass,
String windowName)
Find target window
|
static int |
GetChildWindow(int hWnd)
Get child window
|
static int |
GetDesktopWindow()
Get desktop window
|
static int |
GetNextWindow(int hWnd)
Get next window
|
static int |
GetOwnerWindow(int hWnd)
Get owner window
|
static int |
GetParentWindow(int hWnd)
Get parent window
|
static String |
GetWindowClassName(int hWnd)
Get window class name
|
static org.eclipse.swt.graphics.Rectangle |
GetWindowRectangle(int hWnd)
Get window rectangle
|
static String |
GetWindowText(int hWnd)
Get window text.
|
static boolean |
isPopupMenu(int hwnd)
Check if target is popup menu
|
static boolean |
IsWindowVisible(int hWnd)
Check if target window is visible
|
static boolean |
SetWindowPos(int hWnd,
int hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
int uFlags)
Change size, position and Z order of a target Window.
|
public static final int HWND_TOP
public static final int HWND_TOPMOST
public static final int HWND_NOTOPMOST
public static final int HWND_BOTTOM
public static final int SWP_NOSIZE
public static final int SWP_NOMOVE
public static final int WS_EX_LAYERED
public static final int LWA_COLORKEY
public static final int LWA_ALPHA
public static String GetWindowText(int hWnd)
hWnd
- target windowpublic static String GetWindowClassName(int hWnd)
hWnd
- target windowpublic static org.eclipse.swt.graphics.Rectangle GetWindowRectangle(int hWnd)
hWnd
- target windowpublic static boolean IsWindowVisible(int hWnd)
hWnd
- target windowpublic static int GetDesktopWindow()
public static int GetChildWindow(int hWnd)
hWnd
- target windowpublic static int GetNextWindow(int hWnd)
hWnd
- target windowpublic static int GetOwnerWindow(int hWnd)
hWnd
- target windowpublic static int GetParentWindow(int hWnd)
hWnd
- target windowpublic static boolean isPopupMenu(int hwnd)
hwnd
- target windowpublic static int FindWindow(String windowClass, String windowName)
windowClass
- class namewindowName
- window namepublic static boolean BringWindowToTop(int hWnd)
hWnd
- target windowpublic static boolean SetWindowPos(int hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags)
hWnd
- target windowhWndInsertAfter
- the window to precede the positioned window in the Z order, or
one of the following values (HWND_BOTTOM, HWND_NOTOPMOST,
HWND_TOP, HWND_TOPMOST)X
- new position XY
- new position Ycx
- new widthcy
- new heightuFlags
- window sizing and positioning flags.