全局热键的一些知识
来源:互联网 发布:软件企业质量体系认证 编辑:程序博客网 时间:2024/05/22 03:33
//全局热键的一些知识,程序快捷键也要用到原子。
TmpID:Integer;
begin
TmpID:=GlobalFindAtom(‘MyHotkey’);
if TmpID=0 then //查找全局原子.如果返回值不为0,则说明这个全局原子已经被注册;
id:=GlobalAddAtom(‘MyHotkey’)
else
ID:=TmpID;
TmpID:=GlobalFindAtom(‘MyHotkey2′);
if tmpid=0 then
id2:=globaladdatom(‘MyHotkey2′)
else
id2:=TmpID;
TmpID:=GlobalFindAtom(‘MyHotkey3′);
if tmpid=0 then
id3:=globaladdatom(‘MyHotkey3′)
else
id3:=TmpID;
TmpID:=GlobalFindAtom(‘MyHotkey4′);
if tmpid=0 then
id4:=globaladdatom(‘MyHotkey4′)
else
id4:=TmpID;
RegisterHotKey(Handle, id, 0, $70); //注册热键:
RegisterHotKey(Handle, id2, 0, $71); //注册热键:
RegisterHotKey(Handle, id3, 0, $72); //注册热键:
RegisterHotKey(Handle, id4, 0, $73); //注册热键:
untPublicUnit.h:=untPublicUnit.opencomm(1,2400);
EditRegID.Text:=untPublicUnit.MarkAddDate;
procedure TfrmRegister.WMHotKey(var Msg: TWMHotKey);
begin
if msg.HotKey=ID then //热键esc的消息.
untPublicUnit.voicehanshu(1,”);
if msg.HotKey=id2 then
untPublicUnit.voicehanshu(4,”);
if msg.HotKey=id3 then
untPublicUnit.voicehanshu(10,”);
if msg.HotKey=id4 then
untPublicUnit.voicehanshu(11,”);
end;
procedure TfrmRegister.FormDestroy(Sender: TObject);
begin
UnregisterHotKey(Handle,ID);//释放热键
GlobalDeleteAtom(ID); //删除全局原子ID
UnregisterHotKey(Handle,ID2);//释放热键
GlobalDeleteAtom(ID2); //删除全局原子ID
UnregisterHotKey(Handle,ID3);//释放热键
GlobalDeleteAtom(ID3); //删除全局原子ID
UnregisterHotKey(Handle,ID4);//释放热键
GlobalDeleteAtom(ID4); //删除全局原子ID
end;
- 全局热键的一些知识
- Window 热键 以及全局热键的处理。
- VC全局热键的实现
- Qt 全局热键的实现
- pyqt的全局键盘热键
- 全局热键
- 全局热键
- 全局热键
- C#注册全局热键的方法
- 实现gnome桌面的全局热键
- VC添加全局热键的方法
- Qt 全局热键的详细解析
- 一个实现系统全局热键的模块
- delphi程序全局热键的自定义方法
- 一些终端常用的热键
- 添加全局热键
- VB 全局热键
- C#注册全局热键
- 内部用Drupal/PHP开发规范1.2
- select 最常用到的一些查询写法
- 查找第K大的数据
- MQ 队列管理器间消息通讯的方法
- SET协议
- 全局热键的一些知识
- Ubuntu——用VSFTP搭建FTP服务器(2)
- UBUNTU 上网设置
- struts 拦截器
- 我也开博了~~~
- android Service Activity三种交互方式(付源码)
- Easyui Pagenation应用方法
- 删除重复行中的多余行
- 热释电红外线传感器的工作原理