你可以自己添加一个过程,用message来实现功能,返回值:Value Description MK_CONTROL Set if the CTRL key is down. MK_LBUTTON Set if the left mouse button is down. MK_MBUTTON Set if the middle mouse button is down. MK_RBUTTON Set if the right mouse button is down. MK_SHIFT Set if the SHIFT key is down.既 msg.fwkeys ,快给分...
softcool(泰山); 使用消息如何判断我也是用消息做的处理 Case Msg.Message Of wm_LbuttonDown : wm_LbuttonDbclick : End; 当我在做双击动作时,同时做单击的动作,希望能判断当前做的动作的唯一性
用键捕抓 或者用canve(可能打错)画布功能啊,在画布上写键捕抓程序
给你一段代码,仅供参考(Timer的Interval我是设的20,一开始是Enabled := False); private DblClkTime, PreTime, SecTime: UINT; { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject); begin PreTime := GetTickCount; SecTime := GetTickCount; DblClkTime := GetDoubleClickTime; end;procedure TForm1.Timer1Timer(Sender: TObject); begin if GetTickCount - PreTime > DblClkTime then begin Timer1.Enabled := False; Caption := 'Click'; end; end;procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if GetTickCount - PreTime < DblClkTime then begin Timer1.Enabled := False; Caption := 'Double Click'; end else Timer1.Enabled := True; PreTime := GetTickCount; end;
MK_CONTROL Set if the CTRL key is down.
MK_LBUTTON Set if the left mouse button is down.
MK_MBUTTON Set if the middle mouse button is down.
MK_RBUTTON Set if the right mouse button is down.
MK_SHIFT Set if the SHIFT key is down.既 msg.fwkeys ,快给分...
使用消息如何判断我也是用消息做的处理
Case Msg.Message Of
wm_LbuttonDown :
wm_LbuttonDbclick :
End;
当我在做双击动作时,同时做单击的动作,希望能判断当前做的动作的唯一性
或者用canve(可能打错)画布功能啊,在画布上写键捕抓程序
DblClkTime, PreTime, SecTime: UINT;
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
PreTime := GetTickCount;
SecTime := GetTickCount;
DblClkTime := GetDoubleClickTime;
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
if GetTickCount - PreTime > DblClkTime then
begin
Timer1.Enabled := False;
Caption := 'Click';
end;
end;procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if GetTickCount - PreTime < DblClkTime then
begin
Timer1.Enabled := False;
Caption := 'Double Click';
end else
Timer1.Enabled := True;
PreTime := GetTickCount;
end;