Package com.sun.jna.platform.win32.WinNT

Examples of com.sun.jna.platform.win32.WinNT.HRESULT


   *            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);
  }
View Full Code Here


  public static void main(String[] args) {
    junit.textui.TestRunner.run(Ole32Test.class);
  }

  public void testCoCreateGUID() {
    GUID pguid = new GUID();
    assertEquals(W32Errors.S_OK, Ole32.INSTANCE.CoCreateGuid(pguid));
    assertTrue(pguid.Data1 != 0 || pguid.Data2 != 0 || pguid.Data3 != 0
        && pguid.Data4 != null);
  }
View Full Code Here

  }

  public void testCoCreateInstance() {
    HRESULT hrCI = Ole32.INSTANCE.CoInitializeEx(null, 0);

    GUID guid = Ole32Util
        .getGUIDFromString("{00021401-0000-0000-C000-000000000046}"); // Shell object
    GUID riid = Ole32Util
        .getGUIDFromString("{000214EE-0000-0000-C000-000000000046}"); // IShellLinkA

    PointerByReference pDispatch = new PointerByReference();

    HRESULT hr = Ole32.INSTANCE.CoCreateInstance(guid, null, // pOuter =
View Full Code Here

        assertFalse(Native.toString(pszPath).isEmpty());
    }

   
    private void newAppBar() {
        APPBARDATA data = new APPBARDATA.ByReference();
        data.cbSize.setValue(data.size());
        data.uCallbackMessage.setValue(WM_USER + 1);

        UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_NEW), data);
        assertNotNull(result);
    }
View Full Code Here

        UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_NEW), data);
        assertNotNull(result);
    }

    private void removeAppBar() {
        APPBARDATA data = new APPBARDATA.ByReference();
        data.cbSize.setValue(data.size());
        UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_REMOVE), data);
        assertNotNull(result);

    }
View Full Code Here

  }

  public void testDISPPARAMS() {
    // Build DISPPARAMS
    SAFEARRAY.ByReference safeArg = OleAutoUtil.createVarArray(1);
    OleAutoUtil.SafeArrayPutElement(safeArg, 0, new VARIANT(
        Variant.VARIANT_TRUE));
    //System.out.println(safeArg.toString(true));
  }
View Full Code Here

  public OleAutoTest() {
  }

  public void testSysAllocString() {
    assertEquals(null, OleAuto.INSTANCE.SysAllocString(null));
    BSTR p = OleAuto.INSTANCE.SysAllocString("hello world");
    assertEquals("hello world", p.getValue());
    OleAuto.INSTANCE.SysFreeString(p);
  }
View Full Code Here

    /**
     *
     */
    public MONITORINFO() {
        this.cbSize = new DWORD(size());
    }
View Full Code Here

     * Set the full-screen state of the window.
     *
     * @param fullScreen <code>true</code> to set full-screen; <code>false</code> to exit full-screen
     */
    void setFullScreen(boolean fullScreen) {
        HWND hWnd = getHWND(Native.getComponentID(window));
        if(fullScreen) {
            windowState = getWindowState(hWnd);
            ExtendedUser32.INSTANCE.SetWindowLong(hWnd, GWL_STYLE, windowState.getStyle() & ~(WS_CAPTION | WS_THICKFRAME));
            ExtendedUser32.INSTANCE.SetWindowLong(hWnd, GWL_EXSTYLE, windowState.getExStyle() & ~(WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
            MONITORINFO monitorInfo = getMonitorInfo(hWnd);
View Full Code Here

     *
     * @param componentId component identifier
     * @return native window handle
     */
    private HWND getHWND(long componentId) {
        return new HWND(Pointer.createConstant(componentId));
    }
View Full Code Here

TOP

Related Classes of com.sun.jna.platform.win32.WinNT.HRESULT

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.