|
用delphi实现冰河的远程屏幕操作功能(18) X, Y: Integer); begin ScaleXY(X, Y); LastX := X; LastY := Y;
AddMove(X, Y); end;
procedure TClientForm.AddMove(x, y: integer); var MoveObj : TMoveObj; begin MoveObj := TMoveObj.Create; MoveObj.X := X; MoveObj.Y := Y; MoveObj.Time := GetTickCount; MoveList.Add(MoveObj); end;
procedure TClientForm.ResponseTimerTimer(Sender: TObject); var bm : TBitmap; x, y : integer; begin WaitImage.Hint := Format('Wait: %3.1n seconds', [(GetTickCount-t1)/1000.0]);
bm := TBitmap.Create; bm.Width := WaitImage.Width; bm.Height := WaitImage.Height;
Anim := Anim + 1; Anim := Anim and 31; for x := -1 to 1 do for y := -1 to 1 do bm.Canvas.Draw(Anim + x*32, Anim + y*32, Application.Icon);
WaitImage.Picture.Assign(bm); bm.Free; end;
procedure TClientForm.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ScaleXY(X, Y); but := 1; if Button = mbRight then but := 2; ClearMoveList; AddMove(x, y); end;
procedure TClientForm.Image1Click(Sender: TObject); begin NumClick := 1; ClickTimer.Enabled := True; end;
procedure TClientForm.Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ScaleXY(X, Y); if but = 2 then begin // Only do this for Right Clicks SendMsg(MSG_CLICK, IntToByteStr(LastX) + IntToByteStr(LastY) + IntToByteStr(1 {Single}) + IntToByteStr(but), ClientSocket1.Socket); end; AddMove(x, y); end;
procedure TClientForm.Image1DblClick(Sender: TObject); begin NumClick := 2; ClickTimer.Enabled := True; end;
procedure TClientForm.ClickTimerTimer(Sender: TObject); var s : string; MoveObj : TMoveObj; i : integer; begin ClickTimer.Enabled := False;
if (MoveList.Count < 5) or (NumClick = 2) then begin // This is a Click or Double-click SendMsg(MSG_CLICK, IntToByteStr(LastX) + IntToByteStr(LastY) +
|