本文整理汇总了Java中com.sun.jna.platform.win32.WinDef.WPARAM属性的典型用法代码示例。如果您正苦于以下问题:Java WinDef.WPARAM属性的具体用法?Java WinDef.WPARAM怎么用?Java WinDef.WPARAM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.jna.platform.win32.WinDef
的用法示例。
在下文中一共展示了WinDef.WPARAM属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doKeyPress
@Override
protected void doKeyPress(final int keyCode, final boolean shifted) throws InterruptedException {
logger.log(Level.FINER, "doKeyPress " + keyCode + " " + shifted);
while (isCtrlKeyDown()) {
Thread.sleep(100);
}
final int lParam = 0x00000001 | 0x50 /* scancode */<< 16 | 0x01000000 /* extended */;
final WPARAM wparam = new WinDef.WPARAM(keyCode);
final WPARAM wparamShift = new WinDef.WPARAM(KeyEvent.VK_SHIFT);
final LPARAM lparamDown = new WinDef.LPARAM(lParam);
final LPARAM lparamUp = new WinDef.LPARAM(lParam | 1 << 30 | 1 << 31);
if (shifted) {
User32.INSTANCE.PostMessage(handler, WM_KEYDOWN, wparamShift, lparamDown);
}
User32.INSTANCE.PostMessage(handler, WM_KEYDOWN, wparam, lparamDown);
User32.INSTANCE.PostMessage(handler, WM_KEYUP, wparam, lparamUp);
if (shifted) {
User32.INSTANCE.PostMessage(handler, WM_KEYUP, wparamShift, lparamUp);
}
}
示例2: hookTheMouse
private LowLevelMouseProc hookTheMouse() {
return new LowLevelMouseProc() {
@Override
public WinDef.LRESULT callback(int nCode, WinDef.WPARAM wParam, MSLLHOOKSTRUCT info) {
if (nCode >= 0) {
switch (wParam.intValue()) {
case JNIMouseHook.WM_LBUTTONDOWN:
addEventToQueue(info.pt.x, info.pt.y);
break;
case JNIMouseHook.WM_RBUTTONDOWN:
addEventToQueue(info.pt.x, info.pt.y);
break;
case JNIMouseHook.WM_MBUTTONDOWN:
addEventToQueue(info.pt.x, info.pt.y);
break;
case JNIMouseHook.WM_MOUSEMOVE:
break;
default:
break;
}
// unhook if needed
if (threadFinish == true) {
USER32INST.PostQuitMessage(0);
}
}
Pointer ptr = info.getPointer();
long peer = Pointer.nativeValue(ptr);
return USER32INST.CallNextHookEx(hhk, nCode, wParam, new LPARAM(peer));
}
};
}
示例3: callback
public WinDef.LRESULT callback(WinDef.HWND hwnd, WinDef.UINT Msg, WinDef.WPARAM wParam, WinDef.LPARAM lParam) {
return user32.CallWindowProc(previousProcPtr, hwnd, Msg, wParam, lParam);
}
示例4: callback
WinDef.LRESULT callback(int nCode, WinDef.WPARAM wParam, MSLLHOOKSTRUCT lParam);
示例5: SendMessage
WinDef.LRESULT SendMessage(WinDef.HWND hWnd, int msg, WinDef.WPARAM num1, byte[] num2);
示例6: CallWindowProc
public WinDef.LRESULT CallWindowProc(BaseTSD.LONG_PTR lpPrevWndFunc, WinDef.HWND hWnd, WinDef.UINT Msg, WinDef.WPARAM wParam, WinDef.LPARAM lParam);
示例7: PostMessage
public WinDef.HWND PostMessage(WinDef.HWND hWnd, WinDef.UINT Msg, WinDef.WPARAM wParam, WinDef.LPARAM lParam);