类com.sun.jna.platform.win32.BaseTSD源码实例Demo

下面列出了怎么用com.sun.jna.platform.win32.BaseTSD的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: SikuliX1   文件: RobotDesktop.java
private void doKeyRelease(int keyCode) {
  logRobot(stdAutoDelay, "KeyRelease: WaitForIdle: %s - Delay: %d");
  setAutoDelay(stdAutoDelay);
  // on Windows we detect the current layout in KeyboardLayout.
  // Since this layout is not compatible to AWT Robot, we have to use
  // the User32 API to simulate the key release
  if (Settings.AutoDetectKeyboardLayout && Settings.isWindows()) {
    int scanCode =  SXUser32.INSTANCE.MapVirtualKeyW(keyCode, 0);
    SXUser32.INSTANCE.keybd_event((byte)keyCode, (byte)scanCode, new WinDef.DWORD(WinUser.KEYBDINPUT.KEYEVENTF_KEYUP), new BaseTSD.ULONG_PTR(0));
  }else{
    keyRelease(keyCode);
  }

  if (stdAutoDelay == 0) {
    delay(stdDelay);
  }
  logRobot("KeyRelease: extended delay: %d", stdMaxElapsed);
}
 
源代码2 项目: SikuliX1   文件: RobotDesktop.java
private void doKeyPress(int keyCode) {
  Highlight fakeHighlight = null;
  if (RunTime.get().needsRobotFake()) {
    fakeHighlight = Highlight.fakeHighlight();
  }
  logRobot(stdAutoDelay, "KeyPress: WaitForIdle: %s - Delay: %d");
  setAutoDelay(stdAutoDelay);
  if (null != fakeHighlight) {
    delay(20);
    fakeHighlight.close();
    delay(20);
  }

  // on Windows we detect the current layout in KeyboardLayout.
  // Since this layout is not compatible to AWT Robot, we have to use
  // the User32 API to simulate the key press
  if (Settings.AutoDetectKeyboardLayout && Settings.isWindows()) {
      int scanCode =  SXUser32.INSTANCE.MapVirtualKeyW(keyCode, 0);
      SXUser32.INSTANCE.keybd_event((byte)keyCode, (byte)scanCode, new WinDef.DWORD(0), new BaseTSD.ULONG_PTR(0));
  }else{
    keyPress(keyCode);
  }


  if (stdAutoDelay == 0) {
    delay(stdDelay);
  }
  logRobot("KeyPress: extended delay: %d", stdMaxElapsed);
}
 
源代码3 项目: RemoteSupportTool   文件: WindowsUtils.java
/**
 * Create keyboard input event.
 *
 * @param character character to print
 * @param flags     flags
 * @return keyboard input event
 */
private static WinUser.INPUT createKeyboardInput(char character, long flags) {
    WinUser.INPUT input = new WinUser.INPUT();
    input.type = new WinDef.DWORD(WinUser.INPUT.INPUT_KEYBOARD);
    input.input.setType("ki");
    input.input.ki = new WinUser.KEYBDINPUT();
    input.input.ki.wVk = new WinDef.WORD(0);
    input.input.ki.wScan = new WinDef.WORD(character);
    input.input.ki.time = new WinDef.DWORD(0);
    input.input.ki.dwFlags = new WinDef.DWORD(flags);
    input.input.ki.dwExtraInfo = new BaseTSD.ULONG_PTR();
    return input;
}
 
源代码4 项目: jpexs-decompiler   文件: Win32ProcessTools.java
public static BufferedImage getShellIcon(String path) {
    SHFILEINFO fi = new SHFILEINFO();
    BaseTSD.DWORD_PTR r = Shell32.INSTANCE.SHGetFileInfo(path, 0, fi, fi.size(), Shell32.SHGFI_ICON | Shell32.SHGFI_SMALLICON);
    if (r.intValue() == 0) {
        return null;
    }
    return iconToImage(fi.hIcon);
}
 
源代码5 项目: Spark-Reader   文件: User32.java
BaseTSD.LONG_PTR GetWindowLongPtr(Pointer hWnd, int index); 
源代码6 项目: Spark-Reader   文件: User32.java
BaseTSD.LONG_PTR GetWindowLong(Pointer hWnd, int index); 
 类所在包
 类方法
 同包方法