现在的位置: 首页 > 综合 > 正文

java 调用user32.dll 锁定电脑

2013年09月11日 ⁄ 综合 ⁄ 共 412字 ⁄ 字号 评论关闭
 public interface Kernel32 extends Library {
		public boolean Beep(int FREQUENCY, int DURATION);
		public void Sleep(int DURATION);
	}
	public interface User32 extends Library {
		boolean LockWorkStation();
	}

	public static void main(String[] args) {
		Kernel32 lib = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class);
		lib.Beep(698, 1500);
		lib.Sleep(500);
		lib.Beep(698, 500);
		User32 dll = (User32) Native.loadLibrary("user32", User32.class);
		dll.LockWorkStation();
	}

抱歉!评论已关闭.