com.sun.jna.platform.win32.WinDef.LRESULT Java Examples

The following examples show how to use com.sun.jna.platform.win32.WinDef.LRESULT. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MouseEventReceiver.java    From Simplified-JNA with MIT License 6 votes vote down vote up
@Override
public LRESULT callback(int nCode, WPARAM wParam, MOUSEHOOKSTRUCT info) {
	boolean cancel = false;
	int code = wParam.intValue();
	if (code == WM_MOUSEMOVE) {
		cancel = onMouseMove(info.hwnd, info.pt);
	} else if (code == WM_MOUSESCROLL) {
		boolean down = Pointer.nativeValue(info.hwnd.getPointer()) == 4287102976L;
		cancel = onMouseScroll(down, info.hwnd, info.pt);
	} else if (code == WM_MOUSELDOWN || code == WM_MOUSERDOWN || code == WM_MOUSEMDOWN) {
		onMousePress(MouseButtonType.fromWParam(code), info.hwnd, info.pt);
	} else if (code == WM_MOUSELUP || code == WM_MOUSERUP || code == WM_MOUSEMUP) {
		onMouseRelease(MouseButtonType.fromWParam(code), info.hwnd, info.pt);
	}
	if (cancel) {
		return new LRESULT(1);
	}
	Pointer ptr = info.getPointer();
	long peer = Pointer.nativeValue(ptr);
	return User32.INSTANCE.CallNextHookEx(getHookManager().getHhk(this), nCode, wParam, new LPARAM(peer));
}
 
Example #2
Source File: KeyEventReceiver.java    From Simplified-JNA with MIT License 5 votes vote down vote up
@Override
public LRESULT callback(int nCode, WPARAM wParam, KBDLLHOOKSTRUCT info) {
	int code = wParam.intValue();
	boolean cancel = onKeyUpdate(SystemState.from(code), PressState.from(code), info.time, info.vkCode);
	if (cancel) {
		return new LRESULT(1);
	}
	Pointer ptr = info.getPointer();
	long peer = Pointer.nativeValue(ptr);
	return User32.INSTANCE.CallNextHookEx(getHookManager().getHhk(this), nCode, wParam, new LPARAM(peer));
}
 
Example #3
Source File: MainTestKeyHook.java    From MercuryTrade with MIT License 4 votes vote down vote up
public LRESULT callback(int nCode, WPARAM wParam, LPARAM lParam) {
    System.err.println("callback bbbnhkilhjkibh nCode: " + nCode);
    return new LRESULT(0);
}
 
Example #4
Source File: WinUser.java    From jpexs-decompiler with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @param hwnd [in] Type: HWND
 *
 * A handle to the window.
 *
 * @param uMsg [in] Type: UINT
 *
 * The message.
 *
 * For lists of the system-provided messages, see System-Defined
 * Messages.
 *
 * @param wParam [in] Type: WPARAM
 *
 * Additional message information. The contents of this parameter depend
 * on the value of the uMsg parameter.
 *
 * @param lParam [in] Type: LPARAM
 *
 * Additional message information. The contents of this parameter depend
 * on the value of the uMsg parameter.
 *
 * @return the lresult
 */
LRESULT callback(HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam);
 
Example #5
Source File: LowLevelMouseProc.java    From Simplified-JNA with MIT License votes vote down vote up
public LRESULT callback(int nCode, WPARAM wParam, MOUSEHOOKSTRUCT info); 
Example #6
Source File: WinUser.java    From jpexs-decompiler with GNU General Public License v3.0 votes vote down vote up
LRESULT callback(int nCode, WPARAM wParam, KBDLLHOOKSTRUCT lParam);