A
ajim
Unregistered / Unconfirmed
GUEST, unregistred user!
unit hotkey;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Edit1: TEdit;
procedure GetHotkey(var Msg : TWMHOTKEY);message WM_HOTKEY;
procedure FormCreate(Sender: TObject); //响应敏感键按键消息
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i:integer;
implementation
{$R *.dfm}
procedure TForm1.GetHotKey(var Msg : TWMHOTKEY);
begin
if Msg.HotKey = $DDDDDD then
begin
if memo1.lines='--'then i:=i+1;
edit1.Text:=memo1.lines;
edit1.CopyToClipboard;//问题就在这里 这个句子好像没用亚
i:=i+1;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterHotkey(handle,$DDDDDD,MOD_CONTROL+MOD_Alt,VK_F3);
memo1.lines.LoadFromFile('c:/namelist.txt');
i:=0;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Edit1: TEdit;
procedure GetHotkey(var Msg : TWMHOTKEY);message WM_HOTKEY;
procedure FormCreate(Sender: TObject); //响应敏感键按键消息
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i:integer;
implementation
{$R *.dfm}
procedure TForm1.GetHotKey(var Msg : TWMHOTKEY);
begin
if Msg.HotKey = $DDDDDD then
begin
if memo1.lines='--'then i:=i+1;
edit1.Text:=memo1.lines;
edit1.CopyToClipboard;//问题就在这里 这个句子好像没用亚
i:=i+1;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterHotkey(handle,$DDDDDD,MOD_CONTROL+MOD_Alt,VK_F3);
memo1.lines.LoadFromFile('c:/namelist.txt');
i:=0;
end;
end.