Package com.sun.jna.platform.win32.WinDef

Examples of com.sun.jna.platform.win32.WinDef.HWND


        return Holder.INSTANCE;
    }

    private static class W32WindowUtils extends NativeWindowUtils {
        private HWND getHWnd(Component w) {
            HWND hwnd = new HWND();
            hwnd.setPointer(Native.getComponentPointer(w));
            return hwnd;
        }
View Full Code Here


            if (!isWindowAlphaSupported()) {
                throw new UnsupportedOperationException("Set sun.java2d.noddraw=true to enable transparent windows");
            }
            whenDisplayable(w, new Runnable() {
                public void run() {
                    HWND hWnd = getHWnd(w);
                    User32 user = User32.INSTANCE;
                    int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
                    byte level = (byte)((int)(255 * alpha) & 0xFF);
                    if (usingUpdateLayeredWindow(w)) {
                        // If already using UpdateLayeredWindow, continue to
View Full Code Here

        return;
      }
            whenDisplayable(w, new Runnable() {
                public void run() {
                    User32 user = User32.INSTANCE;
                    HWND hWnd = getHWnd(w);
                    int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof W32TransparentContentPane) {
View Full Code Here

            throw new IllegalArgumentException("Window must be a RootPaneContainer");
        }
        whenDisplayable(w, new Runnable() {
            public void run() {
                User32 user = User32.INSTANCE;
                HWND hWnd = getHWnd(w);
                int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
                if (isClickThrough) {
                    flags |= User32.WS_EX_TRANSPARENT;
                    user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
                }
View Full Code Here

        private void setWindowRegion(final Component w, final HRGN hrgn) {
            whenDisplayable(w, new Runnable() {
                public void run() {
                    GDI32 gdi = GDI32.INSTANCE;
                    User32 user = User32.INSTANCE;
                    HWND hWnd = getHWnd(w);
                    try {
                        user.SetWindowRgn(hWnd, hrgn, true);
                        setForceHeavyweightPopups(getWindow(w), hrgn != null);
                    }
                    finally {
View Full Code Here

    protected void setMask(final Component w, final Rectangle[] rectangles) {
      whenDisplayable(w, new Runnable() {
        public void run() {
          GDI32 gdi = GDI32.INSTANCE;
          User32 user = User32.INSTANCE;
          HWND hWnd = getHWnd(w);
          final HRGN result = gdi.CreateRectRgn(0, 0, 0, 0);
          try {
            if (rectangles == null) {
              gdi.SetRectRgn(result, 0, 0, w.getWidth(), w
                  .getHeight());
View Full Code Here

                    POINT winLoc = new POINT();
                    winLoc.x = win.getX();
                    winLoc.y = win.getY();
                    POINT srcLoc = new POINT();
                    BLENDFUNCTION blend = new BLENDFUNCTION();
                    HWND hWnd = getHWnd(win);
                    // extract current constant alpha setting, if possible
                    ByteByReference bref = new ByteByReference();
                    IntByReference iref = new IntByReference();
                    byte level = getAlpha(win);
                    try {
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

   *  String representation of a GUID, including { }.
   * @return
   *  A GUID.
   */
  public static GUID getGUIDFromString(String guidString) {
    GUID lpiid = new GUID();
      HRESULT hr = Ole32.INSTANCE.IIDFromString(guidString, lpiid);
      if (! hr.equals(W32Errors.S_OK)) {
        throw new RuntimeException(hr.toString());
      }
      return lpiid;
View Full Code Here

TOP

Related Classes of com.sun.jna.platform.win32.WinDef.HWND

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.