怎么做热键编程 就是按热键响应功能,哪位高手教教小弟 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有一个LMD的热键控件,方上去就行了. unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); private id: Integer; procedure WMHotKey(var Msg : TWMHotKey); message WM_HOTKEY; { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation const RSP_SIMPLE_SERVICE=1; function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord; stdcall; external 'KERNEL32.DLL';{$R *.dfm}procedure TForm1.WMHotKey (var Msg : TWMHotKey);begin if msg.HotKey = id then showmessage('你按下热键');end;procedure TForm1.FormCreate(Sender: TObject);Const {ALT、CTRL和F1键的虚拟键值} MOD_ALT = 1; MOD_CONTROL = 2; VK_F1 = 112;begin if GlobalFindAtom('MyHotkey') = 0 then begin id:=GlobalAddAtom('MyHotkey'); RegisterHotKey(handle,id,0,VK_F1);//如果是ALT+F1则为:RegisterHotKey(handle,id,MOD_ALT,VK_F1);如果是Ctrl+Alt+F1则为:RegisterHotKey(handle,id,MOD_CONTROL+MOD_ALT,VK_F1); end else showmessage('热键冲突!');end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);begin UnRegisterHotKey(handle,id); GlobalDeleteAtom(id);end;end. 如何让MDI子窗体保持最大化状态 如何在delphi 中实现VB中的sendkeys的功能? 一个ms-sql server与ms-access集合开发开发的方案问题 数据库记录数的问题 如何得到ie状态栏的文字? 亟待解决的问题,100分全给。 sos 急救 有没有html控件它在什么地方 如何做出这种窗体效果? 求救:有不少问题:delphi的内部错误:URW3537... 请flyinwuhan进来!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
id: Integer;
procedure WMHotKey(var Msg : TWMHotKey); message WM_HOTKEY;
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation const RSP_SIMPLE_SERVICE=1;
function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord; stdcall; external 'KERNEL32.DLL';{$R *.dfm}procedure TForm1.WMHotKey (var Msg : TWMHotKey);
begin
if msg.HotKey = id then
showmessage('你按下热键');
end;
procedure TForm1.FormCreate(Sender: TObject);
Const
{ALT、CTRL和F1键的虚拟键值}
MOD_ALT = 1;
MOD_CONTROL = 2;
VK_F1 = 112;
begin
if GlobalFindAtom('MyHotkey') = 0 then
begin
id:=GlobalAddAtom('MyHotkey');
RegisterHotKey(handle,id,0,VK_F1);//如果是ALT+F1则为:RegisterHotKey(handle,id,MOD_ALT,VK_F1);如果是Ctrl+Alt+F1则为:RegisterHotKey(handle,id,MOD_CONTROL+MOD_ALT,VK_F1);
end
else
showmessage('热键冲突!');
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnRegisterHotKey(handle,id);
GlobalDeleteAtom(id);
end;end.