当前位置: 首页>>代码示例>>Java>>正文


Java Advapi32Util.registrySetIntValue方法代码示例

本文整理汇总了Java中com.sun.jna.platform.win32.Advapi32Util.registrySetIntValue方法的典型用法代码示例。如果您正苦于以下问题:Java Advapi32Util.registrySetIntValue方法的具体用法?Java Advapi32Util.registrySetIntValue怎么用?Java Advapi32Util.registrySetIntValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jna.platform.win32.Advapi32Util的用法示例。


在下文中一共展示了Advapi32Util.registrySetIntValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setIntValue

import com.sun.jna.platform.win32.Advapi32Util; //导入方法依赖的package包/类
/**
 * Applies a Integer(REG_DWORD) value on the specified key.
 *
 * The key will be created if does not exist.
 * The key type will be changed if needed.
 *
 * @param keyPath
 * @param keyName
 * @param keyValue
 */
@Override
public void setIntValue(
                         String rootKey,
                         String keyPath,
                         String keyName,
                         int keyValue ) {

    log.info("Set Intger value '" + keyValue + "' on: " + getDescription(rootKey, keyPath, keyName));

    try {
        Advapi32Util.registrySetIntValue(getHKey(rootKey), keyPath, keyName, keyValue);
    } catch (RuntimeException re) {
        throw new RegistryOperationsException("Couldn't set registry Integer value '" + keyValue
                                              + "' to: "
                                              + getDescription(rootKey, keyPath, keyName),
                                              re);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:29,代码来源:LocalRegistryOperations.java

示例2: doApplySize

import com.sun.jna.platform.win32.Advapi32Util; //导入方法依赖的package包/类
@Override
protected void doApplySize(final Size size) throws BotConfigurationException {
    final int width = size.x();
    final int height = size.y();
    final HKEYByReference key = Advapi32Util.registryGetKey(WinReg.HKEY_LOCAL_MACHINE,
            "SOFTWARE\\BlueStacks\\Guests\\Android\\FrameBuffer\\0", WinNT.KEY_READ | WinNT.KEY_WRITE);
    final int w1 = Advapi32Util.registryGetIntValue(key.getValue(), "WindowWidth");
    final int h1 = Advapi32Util.registryGetIntValue(key.getValue(), "WindowHeight");
    final int w2 = Advapi32Util.registryGetIntValue(key.getValue(), "GuestWidth");
    final int h2 = Advapi32Util.registryGetIntValue(key.getValue(), "GuestHeight");
    if (w1 != width || h1 != height || w2 != width || h2 != height) {
        Advapi32Util.registrySetIntValue(key.getValue(), "WindowWidth", width);
        Advapi32Util.registrySetIntValue(key.getValue(), "WindowHeight", height);
        Advapi32Util.registrySetIntValue(key.getValue(), "GuestWidth", width);
        Advapi32Util.registrySetIntValue(key.getValue(), "GuestHeight", height);
        Advapi32Util.registrySetIntValue(key.getValue(), "FullScreen", 0);
    }
    throw new BotConfigurationException(String.format("Please restart %s to fix resolution", BS_WINDOW_NAME));
}
 
开发者ID:paspiz85,项目名称:nanobot,代码行数:20,代码来源:BlueStacksWinPlatform.java

示例3: writeToKey

import com.sun.jna.platform.win32.Advapi32Util; //导入方法依赖的package包/类
private static void writeToKey(int value) {
    try {
        if (!Advapi32Util.registryKeyExists(WinReg.HKEY_LOCAL_MACHINE, WRITE_BLOCK_KEY)) {
            Advapi32Util.registryCreateKey(WinReg.HKEY_LOCAL_MACHINE, WRITE_BLOCK_KEY);
        }
        Advapi32Util.registrySetIntValue(WinReg.HKEY_LOCAL_MACHINE, WRITE_BLOCK_KEY, "WriteProtect", value);
    }
    catch (IllegalArgumentException e) {
        Logging.log("Failed to " + (value == 0 ? "disable" : "enable") + " USB write block", LogMessageType.WARNING);
        Logging.log(e);
    }

}
 
开发者ID:ciphertechsolutions,项目名称:IO,代码行数:14,代码来源:UsbWriteBlock.java

示例4: resetWriteBlockStatus

import com.sun.jna.platform.win32.Advapi32Util; //导入方法依赖的package包/类
/**
 * Sets the write block key back to what it was when ION launched.
 */
public static void resetWriteBlockStatus() {
    if (!Advapi32Util.registryKeyExists(WinReg.HKEY_LOCAL_MACHINE, WRITE_BLOCK_KEY)) {
        return;
    }
    Advapi32Util.registrySetIntValue(WinReg.HKEY_LOCAL_MACHINE, WRITE_BLOCK_KEY, "WriteProtect", initial_status ? 1 : 0);

}
 
开发者ID:ciphertechsolutions,项目名称:IO,代码行数:11,代码来源:UsbWriteBlock.java


注:本文中的com.sun.jna.platform.win32.Advapi32Util.registrySetIntValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。