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

项目:Hearthtracker    文件:HearthRobot.java   
public static boolean isAeroEnabled(){      
    if( HearthHelper.getOSName().equals("win") && DWM == null){
        try{
            DWM = NativeLibrary.getInstance("dwmapi");
        } catch(Throwable e) {}
    }

    boolean dwmEnabled = false;

       if(DWM != null){
        boolean[] bool = { false };
        Object[] args = { bool };
        Function DwmIsCompositionEnabled = DWM.getFunction("DwmIsCompositionEnabled");
        HRESULT result = (HRESULT) DwmIsCompositionEnabled.invoke(HRESULT.class, args);
        boolean success = result.intValue()==0;

        if(success && bool[0]){
            dwmEnabled = true;
        }
       }  

    return dwmEnabled;
}
项目:jpexs-decompiler    文件:W32Errors.java   
/**
 * Succeeded.
 *
 * @param hr the hr
 * @return true, if successful
 */
public static final boolean SUCCEEDED(HRESULT hr) {
    if (hr != null) {
        return SUCCEEDED(hr.intValue());
    } else {
        return false;
    }
}
项目:jpexs-decompiler    文件:W32Errors.java   
/**
 * Failed.
 *
 * @param hr the hr
 * @return true, if successful
 */
public static final boolean FAILED(HRESULT hr) {
    if (hr != null) {
        return FAILED(hr.intValue());
    } else {
        return false;
    }
}
项目: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());
}
项目:jpexs-decompiler    文件:Win32Exception.java   
/**
 * Returns the error code of the error.
 *
 * @return Error code.
 */
public HRESULT getHR() {
    return _hr;
}
项目:jpexs-decompiler    文件:Win32Exception.java   
/**
 * New Win32 exception from HRESULT.
 *
 * @param hr HRESULT
 */
public Win32Exception(HRESULT hr) {
    //super(Kernel32Util.formatMessageFromHR(hr));
    _hr = hr;
}
项目:jpexs-decompiler    文件:W32Errors.java   
/**
 * Map a WIN32 error value into a HRESULT Note: This assumes that WIN32
 * errors fall in the range -32k to=32k.
 *
 * @param x original w32 error code
 * @return the converted value
 */
public static final HRESULT HRESULT_FROM_WIN32(int x) {
    int f = FACILITY_WIN32;
    return new HRESULT(x <= 0 ? x : ((x) & 0x0000FFFF) | (f <<= 16)
            | 0x80000000);
}
项目:NanoUI    文件:UxTheme.java   
public HRESULT SetWindowTheme(HWND hwnd, WString pszSubAppName, WString pszSubIdList);
项目:NanoUI    文件:DWMapiExt.java   
public HRESULT DwmExtendFrameIntoClientArea(HWND window, MARGINS margins);
项目:NanoUI    文件:DWMapiExt.java   
public HRESULT DwmRegisterThumbnail(HWND hwndDestination, HWND hwndSource, IntByReference phThumbnailId);
项目:NanoUI    文件:DWMapiExt.java   
public HRESULT DwmUnregisterThumbnail(INT_PTR hThumbnailId);
项目:NanoUI    文件:DWMapiExt.java   
public HRESULT DwmQueryThumbnailSourceSize(INT_PTR hThumbnail, SIZE size);
项目:NanoUI    文件:DWMapiExt.java   
public HRESULT DwmUpdateThumbnailProperties(INT_PTR hThumbnailId, DWM_THUMBNAIL_PROPERTIES ptnProperties);
项目:NanoUI    文件:DWMapiExt.java   
public HRESULT DwmGetColorizationColor(DWORDByReference color, BOOLByReference pfOpaqueBlend);
项目:NanoUI    文件:User32Ext.java   
public HRESULT SetWindowCompositionAttribute(HWND hwnd, WindowCompositionAttributeData data);
项目:NanoUI    文件:User32Ext.java   
public HRESULT GetWindowCompositionAttribute(HWND hwnd, WindowCompositionAttributeData task);
项目:AppWoksUtils    文件:Explorerframe.java   
HRESULT SetProgressStateA(HWND h, int i);