org.eclipse.actf.accservice.core.win32.msaa
Class MsaaWindowService

java.lang.Object
  extended by org.eclipse.actf.accservice.core.win32.msaa.MsaaWindowService
All Implemented Interfaces:
Serializable, IWindowService
Direct Known Subclasses:
IA2WindowService

public class MsaaWindowService
extends Object
implements IWindowService

implementation of a window service for the Windows operating system

Author:
Serialized Form

Field Summary
static int HWND_BOTTOM
           
static int HWND_NOTOPMOST
           
static int HWND_TOP
           
static int HWND_TOPMOST
           
static int WH_CALLWNDPROC
           
static int WH_CBT
           
 
Constructor Summary
MsaaWindowService()
           
 
Method Summary
 void addTopLevelWindowListener(TopLevelWindowEventListener listener)
          add a listener to be notified of creation and destruction of top-level native windows
protected  void fireTopLevelWindowEvent(MsaaAccessible ca)
           
 Object getActiveWindow()
          get the active or current window.
static Point getCurrentCursorLocation()
           
 int getCurrentProcessId()
           
 int getProcessId(Object window)
          get the process id with which the given window is associated
static int getSystemMetricsHeight()
           
static int getSystemMetricsWidth()
           
 Object[] getTopLevelWindows()
          retreave all top-level windows from whatever object is considered to be the underlying platform's desktop.
protected  int internalGetActiveWindow()
           
protected static Point internalGetCurrentCursorLocation()
           
protected  int internalGetCurrentProcessId()
           
protected  int internalGetProcessId(int hwnd)
           
protected static int[] internalGetWindowsList()
           
protected  boolean internalRemoveWindowsHook(int hook)
           
protected static void internalSetWindowPosition(int hwnd, int pos)
           
protected  int internalSetWindowsHook(int idHook)
           
protected static void internalShowWindow(int hwnd)
           
 void removeTopLevelWindowListener(TopLevelWindowEventListener listener)
          remove a previously added top-level window listener
 boolean removeWindowsHook(int hook)
          remove a previously registered window hook
 void setActiveWindow(Object window)
          sets the given window as the activeWindow
static int setLayeredWindowAttributes(int hwnd, int crKey, char bAlpha, int dwFlags)
           
 void setWindowNoTop(int hwnd)
           
 void setWindowOnTop(int hwnd)
           
 int setWindowsHook(int hwndHookParam)
          set a windows hook for monitoring window-related events
 void showWindow(int hwnd)
           
protected  void windowCallback(int hwnd)
          not to be used by clients; made public so that native code can reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WH_CALLWNDPROC

public static final int WH_CALLWNDPROC
See Also:
Constant Field Values

WH_CBT

public static final int WH_CBT
See Also:
Constant Field Values

HWND_TOP

public static final int HWND_TOP
See Also:
Constant Field Values

HWND_BOTTOM

public static final int HWND_BOTTOM
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
Constructor Detail

MsaaWindowService

public MsaaWindowService()
Method Detail

getTopLevelWindows

public Object[] getTopLevelWindows()
retreave all top-level windows from whatever object is considered to be the underlying platform's desktop.

Specified by:
getTopLevelWindows in interface IWindowService
Returns:
array of top-level windows or an empty array if unavailable

internalGetWindowsList

protected static int[] internalGetWindowsList()

setActiveWindow

public void setActiveWindow(Object window)
Description copied from interface: IWindowService
sets the given window as the activeWindow

Specified by:
setActiveWindow in interface IWindowService
Parameters:
window - to be set as active

getActiveWindow

public Object getActiveWindow()
Description copied from interface: IWindowService
get the active or current window. This is the window that has keyboard focus andis the subject of processes in the framework (e.g. inspection, validation).

Specified by:
getActiveWindow in interface IWindowService
Returns:
active or current window

internalGetActiveWindow

protected int internalGetActiveWindow()

getProcessId

public int getProcessId(Object window)
get the process id with which the given window is associated

Specified by:
getProcessId in interface IWindowService
Parameters:
window - window for which process id is desired
Returns:
process id for given window or -1 if no id can be obtained

internalGetProcessId

protected int internalGetProcessId(int hwnd)

getCurrentProcessId

public int getCurrentProcessId()
Specified by:
getCurrentProcessId in interface IWindowService
Returns:
process id

internalGetCurrentProcessId

protected int internalGetCurrentProcessId()

setWindowsHook

public int setWindowsHook(int hwndHookParam)
set a windows hook for monitoring window-related events

Parameters:
hwndHookParam - - one of the pre-defined constants in this class
Returns:
hook reference for unregistering listener or -1 if set was unsuccessful

internalSetWindowsHook

protected int internalSetWindowsHook(int idHook)

removeWindowsHook

public boolean removeWindowsHook(int hook)
remove a previously registered window hook

Parameters:
hook - - hook reference obtained from setWindowsHook
Returns:
true if hook successfully removed, false otherwise
See Also:
setWindowsHook(int)

internalRemoveWindowsHook

protected boolean internalRemoveWindowsHook(int hook)

windowCallback

protected void windowCallback(int hwnd)
                       throws InvalidComponentException
not to be used by clients; made public so that native code can reference

Parameters:
hwnd -
Throws:
InvalidComponentException

removeTopLevelWindowListener

public void removeTopLevelWindowListener(TopLevelWindowEventListener listener)
remove a previously added top-level window listener

Specified by:
removeTopLevelWindowListener in interface IWindowService
Parameters:
listener -
See Also:
IWindowService.addTopLevelWindowListener(TopLevelWindowEventListener)

fireTopLevelWindowEvent

protected void fireTopLevelWindowEvent(MsaaAccessible ca)

addTopLevelWindowListener

public void addTopLevelWindowListener(TopLevelWindowEventListener listener)
add a listener to be notified of creation and destruction of top-level native windows

Specified by:
addTopLevelWindowListener in interface IWindowService
Parameters:
listener -

setWindowOnTop

public void setWindowOnTop(int hwnd)

setWindowNoTop

public void setWindowNoTop(int hwnd)

showWindow

public void showWindow(int hwnd)

getCurrentCursorLocation

public static Point getCurrentCursorLocation()

internalGetCurrentCursorLocation

protected static Point internalGetCurrentCursorLocation()

internalShowWindow

protected static void internalShowWindow(int hwnd)

internalSetWindowPosition

protected static void internalSetWindowPosition(int hwnd,
                                                int pos)

setLayeredWindowAttributes

public static final int setLayeredWindowAttributes(int hwnd,
                                                   int crKey,
                                                   char bAlpha,
                                                   int dwFlags)

getSystemMetricsWidth

public static int getSystemMetricsWidth()

getSystemMetricsHeight

public static int getSystemMetricsHeight()