Package com.sun.jna.examples.win32.User32

Examples of com.sun.jna.examples.win32.User32.LowLevelKeyboardProc


        }
   
        if (i) {
            int w = image.getWidth(null);
            int h = image.getHeight(null);
            HDC screenDC = user.GetDC(null);
            HDC memDC = gdi.CreateCompatibleDC(screenDC);
            HBITMAP hBitmap = null;
            HANDLE oldBitmap = null;
           
            try {
                BufferedImage buf = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
View Full Code Here


    private static HHOOK hhk;
    private static LowLevelKeyboardProc keyboardHook;

    public static void main(String[] args) {
        final User32 lib = User32.INSTANCE;
        HMODULE hMod = Kernel32.INSTANCE.GetModuleHandle(null);
        keyboardHook = new LowLevelKeyboardProc() {
            public LRESULT callback(int nCode, WPARAM wParam, KBDLLHOOKSTRUCT info) {
                if (nCode >= 0) {
                    switch(wParam.intValue()) {
                    case User32.WM_KEYUP:
View Full Code Here

            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 (raster == null) {
                            gdi.SetRectRgn(result, 0, 0, w.getWidth(), w.getHeight());
                        }
                        else {
                            final HRGN tempRgn = gdi.CreateRectRgn(0, 0, 0, 0);
                            try {
                                RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
                                    public boolean outputRange(int x, int y, int w, int h) {
                                        GDI32 gdi = GDI32.INSTANCE;
                                        gdi.SetRectRgn(tempRgn, x, y, x + w, y + h);
View Full Code Here

            }
            int[] counts = new int[sizes.size()];
            for (int i=0;i < counts.length;i++) {
                counts[i] = ((Integer)sizes.get(i)).intValue();
            }
            HRGN hrgn = gdi.CreatePolyPolygonRgn(lppt, counts, counts.length, mode);
            setWindowRegion(w, hrgn);
        }
View Full Code Here

            setWindowRegion(w, hrgn);
        }

        protected void setMask(final Component w, final Raster raster) {
            GDI32 gdi = GDI32.INSTANCE;
            final HRGN region = raster != null
                ? gdi.CreateRectRgn(0, 0, 0, 0) : null;
            if (region != null) {
                final HRGN tempRgn = gdi.CreateRectRgn(0, 0, 0, 0);
                try {
                    RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
                        public boolean outputRange(int x, int y, int w, int h) {
                            GDI32 gdi = GDI32.INSTANCE;
                            gdi.SetRectRgn(tempRgn, x, y, x + w, y + h);
View Full Code Here

        return Holder.INSTANCE;
    }

    private static class W32WindowUtils extends NativeWindowUtils {
        public HWND getHWnd(Window w) {
            HWND hwnd = new HWND();
            hwnd.setPointer(Native.getWindowPointer(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 (isTransparent(w)) {
                        // If already using UpdateLayeredWindow, continue to
View Full Code Here

            if (!(transparent ^ isTransparent))
                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();
                    if (transparent && !isTransparent(w)) {
                        flags |= User32.WS_EX_LAYERED;
View Full Code Here

        public void setWindowMask(final Window w, final Raster raster) {
            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 (raster == null) {
                            gdi.SetRectRgn(result, 0, 0, w.getWidth(), w.getHeight());
                        }
View Full Code Here

                    POINT srcLoc = new POINT();
                    BLENDFUNCTION blend = new BLENDFUNCTION();
                    POINT loc = new POINT();
                    loc.x = win.getX();
                    loc.y = win.getY();
                    HWND hWnd = getHWnd(win);
                    // extract current constant alpha setting, if possible
                    ByteByReference bref = new ByteByReference();
                    IntByReference iref = new IntByReference();
                    byte level = getAlpha(win);
                    if (user.GetLayeredWindowAttributes(hWnd, null, bref, iref)
View Full Code Here

TOP

Related Classes of com.sun.jna.examples.win32.User32.LowLevelKeyboardProc

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.