/** * Adds a Console Ctrl Handler. * * @return true if the handler is correctly set * @throws java.lang.UnsatisfiedLinkError if the Kernel32 library is not loaded or if the native function is not found * @throws java.lang.NoClassDefFoundError if the library for native calls is missing */ boolean addConsoleCtrlHandler(ConsoleCtrlHandler handler) { boolean result = false; if (handler != null) { NativeHandlerCallback callback = new NativeHandlerCallback(handler); result = SetConsoleCtrlHandler(callback, true); if (result) { callbacks.add(callback); } } return result; }
/** * Adds a Console Ctrl Handler. * * @return true if the handler is correctly set * @throws java.lang.UnsatisfiedLinkError if the Kernel32 library is not loaded or if the native function is not found * @throws java.lang.NoClassDefFoundError if the library for native calls is missing */ boolean addConsoleCtrlHandler(ConsoleCtrlHandler handler) { boolean result = false; if (handler != null) { NativeHandlerCallback callback = new NativeHandlerCallback(handler); result = SetConsoleCtrlHandler(callback, true); if (result) { callbacks.add(callback); } } return result; }
/** * Adds a Console Ctrl Handler. * * @return true if the handler is correctly set * @throws java.lang.UnsatisfiedLinkError if the Kernel32 library is not loaded or if the native function is not found * @throws java.lang.NoClassDefFoundError if the library for native calls is missing */ boolean addConsoleCtrlHandler(ConsoleCtrlHandler handler) { boolean result = false; if (handler != null) { NativeHandlerCallback callback = new NativeHandlerCallback(handler); result = SetConsoleCtrlHandler(callback, true); if (result) { callbacks.add(callback); } } return result; }
/** * Adds a Console Ctrl Handler. * * @return true if the handler is correctly set * @throws java.lang.UnsatisfiedLinkError if the Kernel32 library is not loaded or if the native function is not found * @throws java.lang.NoClassDefFoundError if the library for native calls is missing */ boolean addConsoleCtrlHandler(ConsoleCtrlHandler handler) { boolean result = false; if (handler != null) { NativeHandlerCallback callback = new NativeHandlerCallback(handler); result = SetConsoleCtrlHandler(callback, true); if (result) { callbacks.add(callback); } } return result; }
/** * Adds a Console Ctrl Handler. * * @return true if the handler is correctly set * @throws java.lang.UnsatisfiedLinkError if the Kernel32 library is not loaded or if the native function is not found * @throws java.lang.NoClassDefFoundError if the library for native calls is missing */ boolean addConsoleCtrlHandler(ConsoleCtrlHandler handler) { boolean result = false; if (handler != null) { NativeHandlerCallback callback = new NativeHandlerCallback(handler); result = SetConsoleCtrlHandler(callback, true); if (result) { callbacks.add(callback); } } return result; }