如何使用JAVA关闭或最小化Windows 10屏幕键盘?

时间:2017-01-25 17:25:31

标签: java processing minimize taskkill on-screen-keyboard

我已经尝试执行taskkill来关闭Windows 10中的屏幕键盘(OSK.exe),但OSK在Windows 10中的行为似乎有所不同...虽然我可以启动应用程序,但我无法将其关闭和之前的taskkill一样。即使在命令提示符下,我也会收到拒绝访问错误... 我会满足于至少最小化它的能力,但这是我不知道该怎么做的......有什么建议吗? 我的处理线看起来像这样

public void onScreenKbdMain_click1(GImageButton source, GEvent event) { 
  println("onScreenKbdMain - GImageButton >> GEvent." + event + " @ " + millis());
  if (keyboardOnOff == false) {
    sentense="Onscreen keyboard activated";
    String[] params = { 
      "C:/bala/bala.exe", "-t", sentense
    }; 
    launch(params);
    //pKeyboard = open(new String[] { "c:/Windows/system32/osk.exe" } ); // Windows Keyboard
    pKeyboard = launch(new String[] { 
      "osk"
      } 
      ); // Windows Keyboard
    keyboardOnOff=!keyboardOnOff;
    //println("keyboardOnOff= "+keyboardOnOff);
  } else {
    sentense="Onscreen keyboard disabled";
    String[] params = { 
      "C:/bala/bala.exe", "-t", sentense
    }; 
    launch(params);
    pKeyboard = launch(new String[] { 
      "taskkill IM/osk.exe/T/F"
      } 
      ); // Windows Keyboard
    keyboardOnOff=!keyboardOnOff;
    //println("keyboardOnOff= "+keyboardOnOff);
  }
}

0 个答案:

没有答案