windows服务中使用blockinput无效
我想实现开机的时候,让鼠标键盘都不能动 半分钟.
要在登陆界面的时候就开始不能动,所以只想到写成windows服务.
[DllImport("USER32.DLL")]
public extern static void BlockInput(bool ABlockInput);
protected override void OnStart(string[] args)
{
BlockInput(true);
}
大家知道是什么原因吗,或者有别的实现方法?