UfrmCapture.pas
资源名称:DarkMoon.rar [点击查看]
上传用户:hndmjx
上传日期:2014-09-16
资源大小:3369k
文件大小:2k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit UfrmCapture;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, StdCtrls,DM5314_UExplorer,DM5314_UCommandsAndUtils;
- type
- TfrmCapture = class(TForm)
- Label1: TLabel;
- imgScreenshot: TImage;
- Timer1: TTimer;
- procedure Label1Click(Sender: TObject);
- procedure imgScreenshotMouseMove(Sender: TObject; Shift: TShiftState;
- X, Y: Integer);
- procedure Timer1Timer(Sender: TObject);
- procedure imgScreenshotMouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- frmCapture: TfrmCapture;
- MousePosX ,MousePosY : integer;
- Counter: integer;
- implementation
- uses Mainform;
- {$R *.dfm}
- procedure TfrmCapture.Label1Click(Sender: TObject);
- begin
- frmCapture.Hide;
- timer1.Enabled:=false;
- frmMain.TimerRDC.Enabled:=false;
- end;
- procedure TfrmCapture.imgScreenshotMouseMove(Sender: TObject;
- Shift: TShiftState; X, Y: Integer);
- begin
- MousePosX:=X ;
- MousePosY:=Y;
- end;
- procedure TfrmCapture.Timer1Timer(Sender: TObject);
- var
- d : string;
- begin
- if typeconnection=0 then begin
- d :='^' + inttostr(MousePosX) +'^' + inttostr(MousePosY) + '^';
- frmMain.KClient.Send(pchar(d),length(d)) ;
- end;
- if typeconnection=1 then begin
- d :='^' + inttostr(MousePosX) +'^' + inttostr(MousePosY) + '^';
- frmMain.KServer.Broadcast(pchar(d),length(d)) ;
- end;
- end;
- procedure TfrmCapture.imgScreenshotMouseDown(Sender: TObject;
- Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- var
- d : string;
- begin
- if timer1.Enabled=true then begin
- if typeconnection=0 then begin
- d :='@' + inttostr(MousePosX) + '@' + inttostr(MousePosY) + '@';
- frmMain.KClient.Send(pchar(d),length(d)) ;
- end;
- if typeconnection=1 then begin
- d :='@' + inttostr(MousePosX) +'@' + inttostr(MousePosY) + '@';
- frmMain.KServer.Broadcast(pchar(d),length(d)) ;
- end;
- end;
- end;
- end.