Class Winreg


  • @Include("winreg.h")
    public abstract class Winreg
    extends Object
    Wrapper around the winreg.h header.
    Author:
    aploese
    • Field Detail

      • HKEY_CLASSES_ROOT

        @Define
        public static final WinDef.HKEY HKEY_CLASSES_ROOT
        HKEY_CLASSES_ROOT Registry entries subordinate to this key define types (or classes) of documents and the properties associated with those types.
      • HKEY_CURRENT_CONFIG

        @Define
        public static final WinDef.HKEY HKEY_CURRENT_CONFIG
        HKEY_CURRENT_CONFIG Registry entries subordinate to this key define types (or classes) of documents and the properties associated with those types.
      • HKEY_CURRENT_USER

        @Define
        public static final WinDef.HKEY HKEY_CURRENT_USER
        HKEY_CURRENT_USER Registry entries subordinate to this key define types (or classes) of documents and the properties associated with those types.
      • HKEY_CURRENT_USER_LOCAL_SETTINGS

        @Define
        public static final WinDef.HKEY HKEY_CURRENT_USER_LOCAL_SETTINGS
        HKEY_CURRENT_USER_LOCAL_SETTINGS Registry entries subordinate to this key define preferences of the current user that are local to the machine.
      • HKEY_DYN_DATA

        @Define
        public static final WinDef.HKEY HKEY_DYN_DATA
        HKEY_CLASSES_ROOT Registry entries subordinate to this key define types (or classes) of documents and the properties associated with those types.
      • HKEY_LOCAL_MACHINE

        @Define
        public static final WinDef.HKEY HKEY_LOCAL_MACHINE
        HKEY_LOCAL_MACHINE Registry entries subordinate to this key define the physical state of the computer, including data about the bus type, system memory, and installed hardware and software.
      • HKEY_PERFORMANCE_NLSTEXT

        @Define
        public static final WinDef.HKEY HKEY_PERFORMANCE_NLSTEXT
        HKEY_PERFORMANCE_NLSTEXT Registry entries subordinate to this key reference the text strings that describe counters in the local language of the area in which the computer system is running.
      • HKEY_PERFORMANCE_TEXT

        @Define
        public static final WinDef.HKEY HKEY_PERFORMANCE_TEXT
        HKEY_PERFORMANCE_TEXT Registry entries subordinate to this key reference the text strings that describe counters in US English.
      • HKEY_USERS

        @Define
        public static final WinDef.HKEY HKEY_USERS
        HKEY_USERS Registry entries subordinate to this key define the default user configuration for new users on the local computer and the user configuration for the current user.
      • HAVE_WINREG_H

        public static boolean HAVE_WINREG_H
    • Constructor Detail

      • Winreg

        public Winreg()
    • Method Detail

      • RegEnumValueW

        public static final long RegEnumValueW​(WinDef.HKEY hKey,
                                               int dwIndex,
                                               Winnt.LPWSTR lpValueName,
                                               IntRef lpType,
                                               WinDef.LPBYTE lpData)
                                        throws NativeErrorException
        RegEnumValueW Enumerates the values for the specified open registry key.The function copies one indexed value name and data block for the key each time it is called.
        Parameters:
        hKey - A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right.
        dwIndex - The index of the value to be retrieved. This parameter should be zero for the first call to the RegEnumValue function and then be incremented for subsequent calls.
        lpValueName - A pointer to a buffer that receives the name of the value as a null-terminated string.
        lpType - A pointer to a variable that receives a code indicating the type of data stored in the specified value. Registry Value Types
        lpData - A pointer to a buffer that receives the data for the value entry. This parameter can be NULL if the data is not required.
        Returns:
        • ERROR_SUCCESS
        • ERROR_NO_MORE_ITEMS if there are no more values available
        • ERROR_MORE_DATA if the lpData buffer is too small to receive the value.
        Throws:
        NullPointerException - if hKey or lpValueName or lpType is null.
        NativeErrorException - if the return value of the native function indicates an error.
      • RegOpenKeyExW

        public static final void RegOpenKeyExW​(WinDef.HKEY hKey,
                                               String lpSubKey,
                                               int ulOptions,
                                               int samDesired,
                                               WinDef.PHKEY phkResult)
                                        throws NativeErrorException
        RegOpenKeyExW Opens the specified registry key. Note that key names are not case sensitive.
        Parameters:
        hKey - a handle to an open registry key.
        lpSubKey - the name of the registry subkey to be opened.
        ulOptions - specifies the option to apply when opening the key. Set this parameter to zero or the following: Winnt#REG_OPTION_OPEN_LINK()
        samDesired - a mask that specifies the desired access rights to the key to be opened. The function fails if the security descriptor of the key does not permit the requested access for the calling process.
        phkResult - a pointer to a variable that receives a handle to the opened key.
        Throws:
        NullPointerException - if hKey or lpSubKey or phkResult is null.
        NativeErrorException - if the return value of the native function indicates an error.