zoukankan
html css js c++ java
显示/隐藏任务栏,屏蔽任务管理器(winform)
Code
1
//
引入命名控件:
2
using
Microsoft.Win32;
3
using
System.Runtime.InteropServices;
4
5
[DllImport(
"
user32.dll
"
, EntryPoint
=
"
FindWindowA
"
)]
6
public
static
extern
IntPtr FindWindowA(
string
lp1,
string
lp2);
//
获取任务栏
7
8
[DllImport(
"
user32.dll
"
, EntryPoint
=
"
ShowWindow
"
)]
9
public
static
extern
IntPtr ShowWindow(IntPtr hWnd,
int
_value);
//
显示/隐藏任务栏
10
11
/**/
///
<summary>
12
///
是否屏蔽CTRL+ALT+DEL
13
///
</summary>
14
///
<param name="i">
1=屏蔽 0=取消屏蔽
</param>
15
public
static
void
ShieldMissionTask(
int
i)
16
{
17
try
18
{
19
//
屏蔽 Ctrl + Alt + Del 键
20
RegistryKey key
=
Registry.CurrentUser;
21
RegistryKey key1
=
key.CreateSubKey(
@"
Software\Microsoft\Windows\CurrentVersion\Policies\System
"
);
22
key1.SetValue(
"
DisableTaskMgr
"
, i, Microsoft.Win32.RegistryValueKind.DWord);
23
}
24
catch
(Exception ex)
25
{
26
throw
ex;
27
}
28
}
29
30
/**/
///
<summary>
31
///
是否显示任务栏
32
///
</summary>
33
///
<param name="i">
5=显示 0=隐藏
</param>
34
public
static
void
ShieldTaskBar(
int
i)
35
{
36
try
37
{
38
IntPtr hTray
=
FindWindowA(
"
Shell_TrayWnd
"
, String.Empty);
//
获取任务栏
39
ShowWindow(hTray, i);
//
隐藏任务栏
40
}
41
catch
(Exception ex)
42
{
43
throw
ex;
44
}
45
}
查看全文
相关阅读:
全面质量管理-质量管理水平(二)
全面质量管理-质量管理历史发展概述(一)
浅谈性能测试流程
git本地分支与远程分支关联与解除关联
Sourcetree 代码管理
HttpRunner3.x 学习8-参数化数据驱动
HttpRunner3.x 学习6-hook机制
PHP =>和->区别
FineBI:实现仪表板分享
椭圆型方程网格生成法
原文地址:https://www.cnblogs.com/gossip/p/1313228.html
最新文章
一条SQL的查询和更新语句是如何执行的?
重要的日志模块--redolog和binlog
同样是线程安全,ConcurrentHashMap 和 Hashtable 的区别?
ConcurrentHashMap 在 Java7 和 8 有何不同?
链表转红黑树的原因?为什么阈值为8?
Redis 的过期策略和内存淘汰机制有什么区别?
回表和索引覆盖介绍
线程安全—相关介绍
JS方式实现隐藏手机号码中间4位数
Centos 7 防火墙
热门文章
如何在 Docker 中运行自定义脚本
Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set。
RxJs的switchMap,mergeMap,concatMap (and exhaustMap)
一些Node.js 包和资源列表
sqlserver查询超时重建索引
sqlserver
matlab绘制绘制频率分布直方图和分布拟合
软件项目全面质量管理-质量管理概述(二)
软件项目全面质量管理-质量概述(一)
全面质量管理-定义及特点(三)
Copyright © 2011-2022 走看看