Java 类com.sun.jna.platform.win32.W32Errors 实例源码

项目:appdirs    文件:ShellFolderResolver.java   
public String resolveFolder(FolderId folderId) {
  int folder = convertFolderId(folderId);

  char[] pszPath = new char[WinDef.MAX_PATH];
  HRESULT result = Shell32.INSTANCE.SHGetFolderPath(null, folder, null, null,
      pszPath);
  if (W32Errors.S_OK.equals(result)) {
    return Native.toString(pszPath);
  }

  logger.error("SHGetFolderPath returns an error: {}", result.intValue());
  throw new AppDirsException(
      "SHGetFolderPath returns an error: " + result.intValue());
}
项目:consulo    文件:DwmApi.java   
/**
 * @return 0 - color in format 0xAARRGGBB, 1 - opaque
 */
public static int[] DwmGetColorizationColor() {
  IntByReference colorRef = new IntByReference();
  IntByReference opaqueRef = new IntByReference();
  WinNT.HRESULT hresult = DwmApi.INSTANCE.DwmGetColorizationColor(colorRef, opaqueRef);
  if(W32Errors.S_OK.equals(hresult)) {
    return new int[] {colorRef.getValue(), opaqueRef.getValue()};
  }
  return new int[2];
}
项目:consulo    文件:DwmApi.java   
public static boolean DwmIsCompositionEnabled() {
  IntByReference reference = new IntByReference();
  WinNT.HRESULT hresult = INSTANCE.DwmIsCompositionEnabled(reference);
  return W32Errors.S_OK.equals(hresult) && reference.getValue() == 1;
}