• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
通过api和键盘钩子彻底屏蔽任务栏和开始菜单
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
通过api和键盘钩子彻底屏蔽任务栏和开始菜单
软件发布 通过api和键盘钩子彻底屏蔽任务栏和开始菜单
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 编程技术 >> Delphi教程 >> 通过api和键盘钩子彻底屏蔽任务栏和开始菜单

通过api和键盘钩子彻底屏蔽任务栏和开始菜单

添加时间: 2006-2-25 4:52:47  作者: Delphi教程  阅读次数:115   来源: http://www.d9soft.com

        在一些碰到过的多媒体软件编制过程中通常需要彻底屏蔽任务条,通常的办法是调用ShowWindow(h,SW_hide)来隐藏任务条,但是不能屏蔽开始菜单,通过键盘的win功能键还是可以打开开始菜单,所以配合键盘钩子,来屏蔽开始菜单。


library HIDE;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Classes,
windows,
messages;

var
hHk :HHOOK;
type
PKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;
KBDLLHOOKSTRUCT = record
vkCode: DWORD;
ScanCode: DWORD;
Flags: DWORD;
Time: DWORD;
dwExtraInfo: DWORD;
end;
{$R *.res}
function ycxsks( yc:Boolean): Boolean;stdcall; //隐藏-显示任务条
var
h:THandle;
begin
if yc = True then
begin
h:=FindWindow('Shell_TrayWnd',nil);
ShowWindow(h,SW_hide); //隐藏任务条
end
else
begin
h:=FindWindow('Shell_TrayWnd',nil);
ShowWindow(h,SW_SHOW); //显示任务条
end;
Result:=true;
end;

function keyHookProc(nCode: Integer;WParam: WPARAM;LParam: LPARAM): LRESULT;stdcall;
//调用键盘钩子,屏蔽左右win功能键
var
p: PKBDLLHOOKSTRUCT;
y: integer;
begin
if nCode<0 then
Result:= CallNextHookEx(hHk,nCode,WParam,LParam)
else
begin
y := 0;
case WParam of
WM_KEYDOWN,WM_SYSKEYDOWN: //按键后判断所按键
begin
p:=PKBDLLHOOKSTRUCT(Lparam);
if p^.vkCode = VK_LWIN then
y := 1;
if p^.vkCode = VK_RWIN then
y := 1;
end;
WM_KEYUP,WM_SYSKEYUP: //松开按键后判断所按键
begin
p:=PKBDLLHOOKSTRUCT(Lparam);
if p^.vkCode = VK_LWIN then
y := 1;
if p^.vkCode = VK_RWIN then
y := 1;
end;
end;
if y=1 then
Result:=1 //如果为WIN功能键则屏蔽
else
Result:= CallNextHookEx(hHk,nCode,WParam,LParam); //其他键放下一个钩子
end
end;

function Enablehide:Boolean;stdcall;export; //外部调用
begin
if hHk = 0 then
begin
hHk := SetWindowsHookEx(13,@keyHookProc,HInstance,0);
Result := True;
end
else
Result := False;
ycxsks(true);
end;

function Disablehide:Boolean; stdcall; export; //外部调用
begin
if hHk <> 0 then
begin
UnHookWindowsHookEx(hHk);
hHk := 0;
Result := True;
end
else
Result := False;
ycxsks(False);
end;

exports
Enablehide,
Disablehide;
end

 

上下文章:

 

上一篇文章: DIY个照相机-Delphi实现摄像头拍照功能 下一篇文章: 创建Photoshop式浮动窗口应用程序

相关文章:

  • 针对微软Server安全漏洞 蠕虫病毒开始流行
  • 雅虎与谷歌修改搜索广告协议 争取通过监管审批
  • 第三届PPS中韩魔兽对抗赛即将开始
  • 微软件官方详解:Windows 7新任务栏功能
  • 腾讯又要开始对非官方QQ动手了

相关软件:

  • 恶意网站HOSTS屏蔽文件 2008.10.20
  • 鼠标键盘记录回放器 2.7
  • 键盘屏幕鼠标记录专家 1.3
  • 腾凌智能数字键盘中文输入法 3.1
  • 快速隐藏任务栏图标 2.0
  • 键盘五笔训练助手 9.05

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

编程技术分类导航

  • ASP & ASP.NET教程
  • PHP教程
  • JSP教程
  • C/C++教程
  • VB & VB.NET教程
  • VC教程
  • Delphi教程
  • BCB教程
  • VFP教程
  • PB教程
  • JAVA教程
  • XML教程
  • C#教程
  • CGI教程

本类经典文章推荐

  • Delphi的两个实用技巧(1)播放Flash
  • Delphi的两个实用技巧(2)巧用Wind...
  • delphi实例编程之--制作可随处拖放...
  • 关于VisiBroker For Delphi的使用...
  • 关于VisiBroker For Delphi的使用...
  • 关于VisiBroker For Delphi的使用...
  • 在线播放器DIY
  • Delphi让你发送Flash电子邮件
  • 在窗口标题区添加按钮
  • 用Delphi 6编程实现自动标注汉语拼...

Delphi教程阅读排行

  • Delphi7从入门到精通之历数Delphi...
  • Delphi的两个实用技巧(1)播放Flash
  • Delphi7从入门到精通之认识Delphi...
  • delphi实例编程之--制作可随处拖放...
  • Delphi控件,我们也可以(1)
  • Delphi的两个实用技巧(2)巧用Wind...
  • Spcomm串口控件的例程
  • 在线播放器DIY
  • Delphi控件,我们也可以(2)
  • 用Delphi + DirectX开发简单RPG游...

编程技术阅读总排行

  • VB入门教程之一
  • Java连接数据库实例
  • VC++之List Box/Check List Box控...
  • 第二章 PowerBuilder 入门之创建新...
  • VC++ List Ctrl控件
  • 第一章 什么是PowerBuilder
  • VC++ Combo Box/Combo Box Ex控件
  • 学C++不得不看的一篇文章
  • VB入门教程之二
  • VC++之Button控件

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有