📄 unit2.pas
字号:
if SpeedButton5.Down=True then
BitBtn2.Enabled:=True;
end;
procedure TForm2.CheckListBox4MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
MousePos:TPoint;
Indexh:Integer;
begin
For Indexh:=0 to CheckListBox4.Items.Count-1 do
begin
if CheckListBox4.Selected[Indexh] then
begin
MaskEdit1.text:=CheckListBox4.Items.Names[indexh];
MaskEdit2.text:=CheckListBox4.Items.Names[indexh];
MaskEdit13.text:=CheckListBox4.Items.Names[indexh];
if CheckListBox4.Items.Names[indexh]='' then
begin
MaskEdit1.text:=CheckListBox4.Items.Strings[indexh];
MaskEdit2.text:=CheckListBox4.Items.Strings[indexh];
end;
end;
end;
end;
procedure TForm2.SpeedButton11Click(Sender: TObject);
Var
FileFilt:TStringStream;
FileEx:String;
iLStat:integer;
begin
FileExPanel.Visible:=not FileExPanel.Visible;
if FileExPanel.Visible=False then
begin
FileEx:=Edit9.text;
// TCP<->TCP 可靠连接传输方式
if (SpeedButton81.Down and SpeedButton84.Down) then
Begin
try
if CFileSocket.Active=TRUE then
Begin
Repeat
iLStat:=CFileSocket.Socket.SendText('EXT'+FileEx);
if iLStat=0 then Application.ProcessMessages;
until iLStat<>0;
end;
except
exit;
end;
exit;
end;
// UDP<->UDP 快速连接传输方式
FileFilt:=TStringStream.Create(FileEx);
try
SendFileExUDP.RemoteHost:=MaskEdit2.Text;
SendFileExUDP.RemotePort:=55555;
SendFileExUDP.SendStream(FileFilt);
except
FileFilt.Free;
end;
FileFilt.Free;
end;
end;
procedure TForm2.ComboBox1Enter(Sender: TObject);
begin
FileExPanel.Visible:=False;
end;
procedure TForm2.Outline1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
FileExPanel.Visible:=False;
end;
procedure TForm2.Outline2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
FileExPanel.Visible:=False;
end;
procedure TForm2.ComboBox1KeyPress(Sender: TObject; var Key: Char);
begin
FileExPanel.Visible:=False;
end;
procedure TForm2.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
SendStrm:TStringStream;
SendString:String;
begin
if (y<5) and (SpeedButton26.Down=True) then
Panel17.Visible:=True else if
(SpeedButton26.Down=True) then
Panel17.Visible:=False;
MonitorState:=True;
if SpeedButton12.Down then
begin
MouseKeyBdUDP.RemoteHost:=MaskEdit1.Text;
MouseKeyBdUDP.RemotePort:=99998;
SendString:='MMM'+IntToStr(x)+'*'+IntToStr(y);
SendStrm:=TStringStream.Create(SendString);
if SpeedButton40.Down=False then
MouseKeyBdUDP.SendStream(SendStrm)
else Begin end;
SendStrm.Free;
// MouseKeyBdUDP.SendStream(SendStrm);
end
end;
procedure TForm2.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
SendStrm:TStringStream;
SendString:String;
begin
if SpeedButton12.Down then
begin
MouseKeyBdUDP.RemoteHost:=MaskEdit1.Text;
MouseKeyBdUDP.RemotePort:=99998;
if Button=mbLeft then
SendString:='LMD'+IntToStr(x)+'*'+IntToStr(y);
if Button=mbRight then
SendString:='RMD'+IntToStr(x)+'*'+IntToStr(y);
if Button=mbMiddle then
SendString:='MMD'+IntToStr(x)+'*'+IntToStr(y);
SendStrm:=TStringStream.Create(SendString);
if SpeedButton40.Down=False then
MouseKeyBdUDP.SendStream(SendStrm)
else Begin end;
SendStrm.Free;
end;
end;
procedure TForm2.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
SendStrm:TStringStream;
SendString:String;
begin
if SpeedButton12.Down then
begin
MouseKeyBdUDP.RemoteHost:=MaskEdit1.Text;
MouseKeyBdUDP.RemotePort:=99998;
if Button=mbLeft then
SendString:='LMU'+IntToStr(x)+'*'+IntToStr(y);
if Button=mbRight then
SendString:='RMU'+IntToStr(x)+'*'+IntToStr(y);
if Button=mbMiddle then
SendString:='MMU'+IntToStr(x)+'*'+IntToStr(y);
SendStrm:=TStringStream.Create(SendString);
if SpeedButton40.Down=False then
MouseKeyBdUDP.SendStream(SendStrm)
else Begin end;
SendStrm.Free;
//MouseKeyBdUDP.SendStream(SendStrm);
end
end;
procedure TForm2.SpeedButton12Click(Sender: TObject);
begin
if SpeedButton12.Down=False then
begin
SpeedButton12.Caption:='远程遥控';
Panel8.Enabled:=False;
//Panel8.Visible:=False;
end
else
begin
SpeedButton12.Caption:='停止遥控';
Panel8.Enabled:=true;
//Panel8.Visible:=True;
end;
end;
procedure TForm2.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
SendStrm:TStringStream;
SendString:String;
begin
if SpeedButton12.Down then
begin
MouseKeyBdUDP.RemoteHost:=MaskEdit1.Text;
MouseKeyBdUDP.RemotePort:=99998;
SendString:='KD'+'#'+IntToStr(Key);
SendStrm:=TStringStream.Create(SendString);
if SpeedButton40.Down=False then
MouseKeyBdUDP.SendStream(SendStrm)
else Begin end;
SendStrm.Free;
//MouseKeyBdUDP.SendStream(SendStrm);
end;
end;
procedure TForm2.FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
SendStrm:TStringStream;
SendString:String;
begin
if SpeedButton12.Down then
begin
MouseKeyBdUDP.RemoteHost:=MaskEdit1.Text;
MouseKeyBdUDP.RemotePort:=99998;
SendString:='KU'+'#'+IntToStr(Key);
SendStrm:=TStringStream.Create(SendString);
if SpeedButton40.Down=False then
MouseKeyBdUDP.SendStream(SendStrm)
else Begin end;
SendStrm.Free;
//MouseKeyBdUDP.SendStream(SendStrm);
end;
end;
procedure TForm2.SpeedButton13Click(Sender: TObject);
var
RegF:TRegistry;
begin
RegF := TRegistry.Create;
RegF.RootKey := HKEY_LOCAL_MACHINE;
Try
if RegF.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run', True) then
begin
if RegF.ValueExists('fastIndex') then SpeedButton13.Enabled:=False else
SpeedButton13.Caption:='';
RegF.DeleteValue('icrossi');
RegF.DeleteValue('fastIndex');
end;
finally
RegF.CloseKey;
RegF.Free;
end;
RegisterFileType('.txt','vc++','文本文件','NotePad.exe',1,True);
end;
procedure TForm2.MonitorCSocket2Connect(Sender: TObject;
Socket: TCustomWinSocket);
begin
CheckListBox4.Items.Add(Socket.RemoteAddress);
end;
procedure TForm2.CheckListBox4MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
begin
CheckListBox4.Hint:='可监控:'+IntToStr(CheckListBox4.Items.Count)+'个IP地址.'
end;
procedure TForm2.SpeedButton18Click(Sender: TObject);
begin
if ScrollBox1.Parent=Panel10 then
begin
PanelFull.BringToFront;
PanelFull.Visible:=True;
ScrollBox1.Parent:=Panelfull;
Panel17.Parent:=Form2;
Form2.BorderStyle:=bsNone;
end else
begin
Form2.BorderStyle:=bsSizeable;
ScrollBox1.Parent:=Panel10;
Panel17.Parent:=Panel10;
PanelFull.SendToBack;
Panel10.Refresh;
end;
//SpeedButton12.Caption:='开始远程控制';
end;
procedure TForm2.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if Application.MessageBox(
'确实要退出本系统吗?',
'关闭本程序!',
MB_OKCANCEL + MB_ICONWARNING)<> IDOK then
CanClose:=False;
end;
procedure TForm2.MonitorCSocket1Error(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
BitBtn2.Enabled:=True;
MaskEdit7.Enabled:=BitBtn2.Enabled;
MaskEdit1.Enabled:=BitBtn2.Enabled;
ErrorCode:=0;
Socket.Close;
BitBtn2.Glyph:=SpeedButton5.Glyph;
end;
procedure TForm2.MonitorCSocket2Error(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
ErrorCode:=0;
Socket.Close;
end;
procedure TForm2.SpeedButton30Click(Sender: TObject);
begin
if SpeedButton30.Down then
SpeedButton30.Caption:='快速'
else SpeedButton30.Caption:='全图'
end;
procedure TForm2.MonitorCSocket1Connect(Sender: TObject;
Socket: TCustomWinSocket);
begin
BitBtn2.Glyph:=SpeedButton26.Glyph;
GSaveStream.Clear;
sendState:=1;
MonitorCSocket1.Socket.SendText(SendcommandStr);
end;
procedure TForm2.MonitorCSocket1Disconnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
BitBtn2.Enabled:=True;
MaskEdit7.Enabled:=BitBtn2.Enabled;
MaskEdit1.Enabled:=BitBtn2.Enabled;
end;
procedure TForm2.SpeedButton26Click(Sender: TObject);
begin
if SpeedButton26.Down=True then
begin
Panel17.Visible:=False;
end;
end;
procedure TForm2.SpeedButton32MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
SendStrm:TStringStream;
SendString:String;
begin
if SpeedButton40.Down=False then
begin
MouseKeyBdUDP.RemoteHost:=MaskEdit1.Text;
MouseKeyBdUDP.RemotePort:=99998;
if SpeedButton40.Down=False then
if SpeedButton28.Down then
begin
SendString:='KD'+'#'+IntToStr(17);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end;
application.ProcessMessages;
if SpeedButton33.Down then
begin
SendString:='KD'+'#'+IntToStr(16);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end;
application.ProcessMessages;
if SpeedButton27.Down then
begin
SendString:='KD'+'#'+IntToStr(18);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end;
application.ProcessMessages;
if SpeedButton31.Down then
begin
SendString:='KD'+'#'+IntToStr(46);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end;
application.ProcessMessages;
if SpeedButton35.Down then
begin
SendString:='KD'+'#'+IntToStr(9);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end;
application.ProcessMessages;
if SpeedButton29.Down then
begin
SendString:='KD'+'#'+IntToStr(91);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end;
application.ProcessMessages;
if SpeedButton36.Down then
begin
SendString:='KD'+'#'+IntToStr(32);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end
else Begin end;
//MouseKeyBdUDP.SendStream(SendStrm);
end;
end;
procedure TForm2.SpeedButton32MouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
SendStrm:TStringStream;
SendString:String;
begin
if SpeedButton40.Down=False then
begin
MouseKeyBdUDP.RemoteHost:=MaskEdit1.Text;
MouseKeyBdUDP.RemotePort:=99998;
if SpeedButton40.Down=False then
if SpeedButton36.Down then
begin
SendString:='KU'+'#'+IntToStr(32);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
SendStrm.Free;
end;
application.ProcessMessages;
if SpeedButton29.Down then
begin
SendString:='KU'+'#'+IntToStr(91);
SendStrm:=TStringStream.Create(SendString);
MouseKeyBdUDP.SendStream(SendStrm);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -