dsto.dfc.util.win32
Class Win32

java.lang.Object
  extended by dsto.dfc.util.win32.Win32

public final class Win32
extends Object

General Win32 initialisation and utilities.

Version:
$Revision$
Author:
Matthew Phillips

Field Summary
static int CSIDL_APPDATA
           
static int CSIDL_LOCAL_APPDATA
           
static int DESKTOP_BOTTOM
           
static int DESKTOP_LEFT
           
static int DESKTOP_RIGHT
           
static int DESKTOP_TOP
           
static int PBT_APMRESUMESUSPEND
           
static int PBT_APMSUSPEND
           
static int WIN32_NOK_LIBRARY
           
static int WIN32_NOK_OTHER
           
static int WIN32_NOK_PLATFORM
           
static int WIN32_OK
           
static int WM_LBUTTONDBLCLK
           
static int WM_LBUTTONDOWN
           
static int WM_LBUTTONUP
           
static int WM_MBUTTONDBLCLK
           
static int WM_MBUTTONDOWN
           
static int WM_MBUTTONUP
           
static int WM_MOUSEFIRST
           
static int WM_MOUSEMOVE
           
static int WM_RBUTTONDBLCLK
           
static int WM_RBUTTONDOWN
           
static int WM_RBUTTONUP
           
 
Method Summary
static int getWin32State()
          Get the state of the Win32 library.
static void initLibrary()
          Load and initialize the Win32 DLL.
static boolean isWin32Available()
          True if Win32 calls are available.
protected static void powerCallback(int pbtEvent)
           
static void setPowerListener(PowerListener l)
           
static String shellGetFolderPath(int type)
          Call the Win32 SHGetFolderPath () function to get a local folder location.
static void winAppbarDock(int hwnd, int position, int width, int height)
           
static void winAppbarUndock(int hwnd)
           
static boolean winInFullScreenMode()
           
static void winRegisterMessageWindow(int hwnd)
           
static void winSetAlwaysOnTop(int hwnd, boolean onTop)
           
static void winSetOnTop(int hwnd, boolean onTop)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIN32_OK

public static final int WIN32_OK
See Also:
Constant Field Values

WIN32_NOK_PLATFORM

public static final int WIN32_NOK_PLATFORM
See Also:
Constant Field Values

WIN32_NOK_LIBRARY

public static final int WIN32_NOK_LIBRARY
See Also:
Constant Field Values

WIN32_NOK_OTHER

public static final int WIN32_NOK_OTHER
See Also:
Constant Field Values

WM_MOUSEFIRST

public static final int WM_MOUSEFIRST
See Also:
Constant Field Values

WM_MOUSEMOVE

public static final int WM_MOUSEMOVE
See Also:
Constant Field Values

WM_LBUTTONDOWN

public static final int WM_LBUTTONDOWN
See Also:
Constant Field Values

WM_LBUTTONUP

public static final int WM_LBUTTONUP
See Also:
Constant Field Values

WM_LBUTTONDBLCLK

public static final int WM_LBUTTONDBLCLK
See Also:
Constant Field Values

WM_RBUTTONDOWN

public static final int WM_RBUTTONDOWN
See Also:
Constant Field Values

WM_RBUTTONUP

public static final int WM_RBUTTONUP
See Also:
Constant Field Values

WM_RBUTTONDBLCLK

public static final int WM_RBUTTONDBLCLK
See Also:
Constant Field Values

WM_MBUTTONDOWN

public static final int WM_MBUTTONDOWN
See Also:
Constant Field Values

WM_MBUTTONUP

public static final int WM_MBUTTONUP
See Also:
Constant Field Values

WM_MBUTTONDBLCLK

public static final int WM_MBUTTONDBLCLK
See Also:
Constant Field Values

DESKTOP_LEFT

public static final int DESKTOP_LEFT
See Also:
Constant Field Values

DESKTOP_TOP

public static final int DESKTOP_TOP
See Also:
Constant Field Values

DESKTOP_RIGHT

public static final int DESKTOP_RIGHT
See Also:
Constant Field Values

DESKTOP_BOTTOM

public static final int DESKTOP_BOTTOM
See Also:
Constant Field Values

PBT_APMSUSPEND

public static final int PBT_APMSUSPEND
See Also:
Constant Field Values

PBT_APMRESUMESUSPEND

public static final int PBT_APMRESUMESUSPEND
See Also:
Constant Field Values

CSIDL_APPDATA

public static final int CSIDL_APPDATA
See Also:
Constant Field Values

CSIDL_LOCAL_APPDATA

public static final int CSIDL_LOCAL_APPDATA
See Also:
Constant Field Values
Method Detail

initLibrary

public static void initLibrary()
Load and initialize the Win32 DLL. May be called more than once - all calls after first have no effect.

See Also:
getWin32State()

getWin32State

public static int getWin32State()
Get the state of the Win32 library.

Returns:
One of WIN32_OK (loaded OK), WIN32_NOK_LIBRARY (not OK - could not find library), WIN32_NOK_PLATFORM (not OK - not a Win32 platform) or WIN32_NOK_OTHER (not OK - some other error occurred during initialisation).
See Also:
isWin32Available()

isWin32Available

public static boolean isWin32Available()
True if Win32 calls are available. Synonym for getWin32State () == WIN32_OK

See Also:
getWin32State()

setPowerListener

public static void setPowerListener(PowerListener l)

powerCallback

protected static void powerCallback(int pbtEvent)

shellGetFolderPath

public static String shellGetFolderPath(int type)
Call the Win32 SHGetFolderPath () function to get a local folder location.

Parameters:
type - The type of location. One of the CSIDL_* constants.
Returns:
The path, or null if the call failed.

winSetAlwaysOnTop

public static void winSetAlwaysOnTop(int hwnd,
                                     boolean onTop)

winSetOnTop

public static void winSetOnTop(int hwnd,
                               boolean onTop)

winAppbarDock

public static void winAppbarDock(int hwnd,
                                 int position,
                                 int width,
                                 int height)

winAppbarUndock

public static void winAppbarUndock(int hwnd)

winInFullScreenMode

public static boolean winInFullScreenMode()

winRegisterMessageWindow

public static void winRegisterMessageWindow(int hwnd)


Copyright © 2008 Commonwealth of Australia