java 调用user32.dll 锁定电脑

 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();
	}

展开阅读全文
博主设置当前文章不允许评论。

没有更多推荐了,返回首页