C#学习过程中遇到问题,目的是想锁定自己计算机的屏幕,不允许操作
[DllImport("user32")]
private static extern int IsWindowEnabled(int hwnd);
[DllImport("user32")]
private static extern int EnableWindow(int hwnd, int fEnable);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern IntPtr GetDesktopWindow(); 按纽中代码
int i = IsWindowEnabled(GetDesktopWindow);
if (i != 0)
{
EnableWindow(FOwner.Handle, 0);
}
提示出错,怎样解决啊!请各位指点怎么解决啊!
[DllImport("user32")]
private static extern int IsWindowEnabled(int hwnd);
[DllImport("user32")]
private static extern int EnableWindow(int hwnd, int fEnable);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern IntPtr GetDesktopWindow(); 按纽中代码
int i = IsWindowEnabled(GetDesktopWindow);
if (i != 0)
{
EnableWindow(FOwner.Handle, 0);
}
提示出错,怎样解决啊!请各位指点怎么解决啊!
解决方案 »
- 无法实现接口成员,因为它不是公共的?
- DataGridView 如何显示符合条件的记录(即查找功能)
- 我在一个普通类里,如何获得Application实例
- 我安装了VS2005,但是c#的工具箱“数据”下面没有datalist控件,请问该怎么办?
- 为什么不能向类的属性赋值?
- 大家帮帮忙
- 兄弟们帮忙找一些关于Remoting 通信方面的资料和实例代码
- thoughtwork公司参加笔试 没有通过 把题给大家看看
- notifyIcon绑定ContextMenuShip怎么在右侧弹出?
- c# 如何截取屏幕上的数字?
- SQL事务,同时执行纯sql语句和带参的SQL语句
- C#连接oracle问题求救!急~~~~~
参考
参考
private static extern int EnableWindow(IntPtr hwnd, bool fEnable); 参数类型错了