/** Utility method to get the native window pointer for a Java * {@link Window} as a {@link Pointer} value. This method is primarily for * w32, which uses the <code>HANDLE</code> type (actually * <code>void *</code>) to identify windows. * @throws HeadlessException if the current VM is running headless */ public static Pointer getWindowPointer(Window w) throws HeadlessException { return getComponentPointer(w); }
private static WinDef.HWND getHWnd(Component w) { WinDef.HWND hwnd = new WinDef.HWND(); hwnd.setPointer(Native.getComponentPointer(w)); return hwnd; }
private HWND getHWnd(Component w) { HWND hwnd = new HWND(); hwnd.setPointer(Native.getComponentPointer(w)); return hwnd; }
private HWND getHWnd(Component w) { HWND hwnd = new HWND(); hwnd.setPointer(Native.getComponentPointer(w)); return hwnd; }
/** * Sets the native window for the {@link Element} to use to display video. * * @param window A native window to use to display video, or <tt>null</tt> to * stop using the previously set window. * @deprecated use {@link org.gstreamer.swing.XOverlaySwing#setWindowHandle(java.awt.Component)} instead */ @Deprecated public void setWindowHandle(java.awt.Component window) { if (window == null) { setWindowHandle(0); return; } if (window.isLightweight()) throw new IllegalArgumentException("Component must be a native window"); if (Platform.isWindows()) GSTXOVERLAY_API.gst_x_overlay_set_window_handle(this, Native.getComponentPointer(window)); else setWindowHandle(Native.getComponentID(window)); }
/** * Sets the native window for the {@link Element} to use to display video. * * @param window A native window to use to display video, or <tt>null</tt> to * stop using the previously set window. */ public void setWindowHandle(java.awt.Component window) { long nativeWindow = 0; if (window != null) { if (window.isLightweight()) { throw new IllegalArgumentException("Component must be a native window"); } if (Platform.isWindows()) { nativeWindow = Pointer.nativeValue(Native.getComponentPointer(window)); } else { nativeWindow = Native.getComponentID(window); } } setWindowHandle(nativeWindow); } }
/** * Sets the native window for the {@link Element} to use to display video. * * @param window A native window to use to display video, or <tt>null</tt> to * stop using the previously set window. */ public void setWindowHandle(java.awt.Component window) { if (window == null) { setWindowHandle(0); return; } if (window.isLightweight()) throw new IllegalArgumentException("Component must be a native window"); if (Platform.isWindows()) GSTXOVERLAY_API.gst_x_overlay_set_window_handle(this, Native.getComponentPointer(window)); else setWindowHandle(Native.getComponentID(window)); }
/** * Sets the native window for the {@link Element} to use to display video. * * @param window A native window to use to display video, or <tt>null</tt> to * stop using the previously set window. */ public void setWindowHandle(java.awt.Component window) { if (window == null) { setWindowHandle(0); return; } if (window.isLightweight()) throw new IllegalArgumentException("Component must be a native window"); if (Platform.isWindows()) GSTVIDEOOVERLAY_API.gst_video_overlay_set_window_handle(this, Native.getComponentPointer(window)); else setWindowHandle(Native.getComponentID(window)); }
public WindowsPowerXP() { if (!Kernel32Ex.INSTANCE.SetProcessShutdownParameters(0x03FF, 0)) throw new GetLastErrorException(); mp.start(); if (!Kernel32Ex.INSTANCE.SetConsoleCtrlHandler(hr, true)) throw new GetLastErrorException(); final HWND hwnd = new HWND(); f.pack(); hwnd.setPointer(Native.getComponentPointer(f)); int wID = User32.INSTANCE.GetWindowThreadProcessId(hwnd, null); hHook = User32.INSTANCE.SetWindowsHookEx(WH_CALLWNDPROC, hp, null, wID); if (hHook == null) throw new GetLastErrorException(); }