java.awt.Robot robot=new java.awt.Robot();
robot.keyPress(java.awt.event.KeyEvent.VK_CONTROL);
robot.keyPress(java.awt.event.KeyEvent.VK_ALT);
robot.keyPress(java.awt.event.KeyEvent.VK_DELETE);robot.keyRelease(java.awt.event.KeyEvent.VK_DELETE);
robot.keyRelease(java.awt.event.KeyEvent.VK_ALT);
robot.keyRelease(java.awt.event.KeyEvent.VK_CONTROL);
这样写为什么不成功?

解决方案 »

  1.   

    It is handled differently by operation systems. For example, in windows 2000 and above, it is registered as a hotkey by winlogon.exe, and is handled in a window on the SAS desktop, not the application desktop. You need to open the SAS desktop, and broadcast a WM_HOTKEY message. However, I doubt you can do this in your java virtual machine.Reference:
    www.codeproject.com/system/alt_control_delete. asp
      

  2.   

    jiangsheng(蒋晟.MSMVP2004Jan) 你好:  用java 如何实现??
      

  3.   

    蒋晟.MSMVP2004Jan
    好似几强劲!!
      

  4.   

    java?不知……虚拟机不是应该和操作系统无关的么?