Class MSWinLib

java.lang.Object
net.thevpc.common.deskauto.impl.win.MSWinLib

public class MSWinLib extends Object
  • Field Details

  • Method Details

    • getClassName

      public static String getClassName(String title, String control)
    • getClassName

      public static String getClassName(String title, String text, String control)
    • getClassName

      public static String getClassName(String handle)
    • getClassName

      public static String getClassName(com.sun.jna.platform.win32.WinDef.HWND hWnd)
    • getControlId

      public static int getControlId(com.sun.jna.platform.win32.WinDef.HWND controlHwnd)
      Retrieves the identifier of the specified control.
      Parameters:
      controlHwnd - A handle to the control.
      Returns:
      If the function succeeds, the return value is the identifier of the control. If the function fails, the return value is -1. An invalid value for the hwndCtl parameter, for example, will cause the function to fail.
    • getControlText

      public static String getControlText(com.sun.jna.platform.win32.WinDef.HWND hCtrl)
    • getFileVersion

      public static String getFileVersion(String filename)
      Retrieves version information for the specified file.
      Parameters:
      filename - The name of the file to get version information.
      Returns:
      Return version information for the specified file if success, return null if failed.
    • getFileVersion

      public static String getFileVersion(File file)
      Retrieves version information for the specified file.
      Parameters:
      file - The file to get version information.
      Returns:
      Return version information for the specified file if success, return null if failed.
    • getWindowText

      public static String getWindowText(com.sun.jna.platform.win32.WinDef.HWND hWnd)
    • isCapslockOn

      public static boolean isCapslockOn()
      Check whether the capslock is on or not.
      Returns:
      Return true if the capslock is on, otherwise return false.
    • isComboBox

      public static boolean isComboBox(String title, String control)
    • isComboBox

      public static boolean isComboBox(String title, String text, String control)
    • isComboBox

      public static boolean isComboBox(com.sun.jna.platform.win32.WinDef.HWND hWnd)
    • isClassName

      public static boolean isClassName(com.sun.jna.platform.win32.WinDef.HWND hWnd, String className)
    • isHWnd

      public static boolean isHWnd(com.sun.jna.platform.win32.WinDef.HWND hWnd)
      Checks if the handle is a valid window handle.
      Parameters:
      hWnd - Handle to the window.
      Returns:
      Returns true if the handle is a valid window handle, otherwise returns false.
    • isListBox

      public static boolean isListBox(String title, String control)
    • isListBox

      public static boolean isListBox(String title, String text, String control)
    • isListBox

      public static boolean isListBox(com.sun.jna.platform.win32.WinDef.HWND hWnd)
    • setCapslockState

      public static void setCapslockState(boolean on)
      Set the status of the capslock.
      Parameters:
      on - Turn on capslock if true, otherwise turn off capslock.