org.eclipse.actf.util.win32
Class WindowUtil

java.lang.Object
  extended by org.eclipse.actf.util.win32.WindowUtil

public class WindowUtil
extends Object

Utility class for window handle.


Field Summary
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 Summary
WindowUtil()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HWND_TOP

public static final int HWND_TOP
See Also:
Constant Field Values

HWND_TOPMOST

public static final int HWND_TOPMOST
See Also:
Constant Field Values

HWND_NOTOPMOST

public static final int HWND_NOTOPMOST
See Also:
Constant Field Values

HWND_BOTTOM

public static final int HWND_BOTTOM
See Also:
Constant Field Values

SWP_NOSIZE

public static final int SWP_NOSIZE
See Also:
Constant Field Values

SWP_NOMOVE

public static final int SWP_NOMOVE
See Also:
Constant Field Values

WS_EX_LAYERED

public static final int WS_EX_LAYERED
See Also:
Constant Field Values

LWA_COLORKEY

public static final int LWA_COLORKEY
See Also:
Constant Field Values

LWA_ALPHA

public static final int LWA_ALPHA
See Also:
Constant Field Values
Constructor Detail

WindowUtil

public WindowUtil()
Method Detail

GetWindowText

public static String GetWindowText(int hWnd)
Get window text.

Parameters:
hWnd - target window
Returns:
window text

GetWindowClassName

public static String GetWindowClassName(int hWnd)
Get window class name

Parameters:
hWnd - target window
Returns:
window class name

GetWindowRectangle

public static org.eclipse.swt.graphics.Rectangle GetWindowRectangle(int hWnd)
Get window rectangle

Parameters:
hWnd - target window
Returns:
window rectangle

IsWindowVisible

public static boolean IsWindowVisible(int hWnd)
Check if target window is visible

Parameters:
hWnd - target window
Returns:
true if the target window is visible

GetDesktopWindow

public static int GetDesktopWindow()
Get desktop window

Returns:
desktop window

GetChildWindow

public static int GetChildWindow(int hWnd)
Get child window

Parameters:
hWnd - target window
Returns:
child window of the target

GetNextWindow

public static int GetNextWindow(int hWnd)
Get next window

Parameters:
hWnd - target window
Returns:
next window of the target

GetOwnerWindow

public static int GetOwnerWindow(int hWnd)
Get owner window

Parameters:
hWnd - target window
Returns:
owner window of the target

GetParentWindow

public static int GetParentWindow(int hWnd)
Get parent window

Parameters:
hWnd - target window
Returns:
parent window of the target

isPopupMenu

public static boolean isPopupMenu(int hwnd)
Check if target is popup menu

Parameters:
hwnd - target window
Returns:
true if the target is popup menu

FindWindow

public static int FindWindow(String windowClass,
                             String windowName)
Find target window

Parameters:
windowClass - class name
windowName - window name
Returns:
target window, or null if not available

BringWindowToTop

public static boolean BringWindowToTop(int hWnd)
Bring target Window to top

Parameters:
hWnd - target window
Returns:
true if succeeded

SetWindowPos

public 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.

Parameters:
hWnd - target window
hWndInsertAfter - 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 X
Y - new position Y
cx - new width
cy - new height
uFlags - window sizing and positioning flags.
Returns:
true if succeeded