우선 3초마다 메세지를 띄우는 걸로 코딩했네요
참고되셨으면 합니다
이게 키인것 같군요
* API로 enter($0D) 누르기 *
keybd_event($0D,MapVirtualkey($51, 0),0, 0);
keybd_event($0D,MapVirtualkey($51, 0),KEYEVENTF_KEYUP,0);
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ShellApi;
type
TForm1 = class(TForm)
Edit1: TEdit;
Timer1: TTimer;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
timer1.Enabled := true;
edit1.setfocus;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
//API로 enter($0D) 누르기
keybd_event($0D,MapVirtualkey($51, 0),0, 0);
keybd_event($0D,MapVirtualkey($51, 0),KEYEVENTF_KEYUP,0);
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
If Key = #13 then
Begin
Key := #0;
showmessage('HI HI');
End;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action := cafree;
end;
end.