procedure TfrmSendMsg.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TfrmSendMsg.bbtnSendClick(Sender: TObject);
var
i,res:Integer;
begin
if AddrBox.Text<>'' then
begin
StatusPanel.Font.Color:=clBlack;
StatusPanel.Caption:='请稍等......';
Update;
if AddrBox.Items.IndexOf(AddrBox.Text)=-1 then
AddrBox.Items.Add(AddrBox.Text);
res:=SendMsg(AddrBox.Text,'',MessageHeader.Text+mesText.Text);
//ShowMessage(IntToStr(res));
if res=0 then
begin
frmSendMsg.StatusPanel.Caption:='消息已成功送出';
frmSendMsg.StatusPanel.Font.Color:=clBlue;
end;
try
if res=87 then
begin
frmSendMsg.StatusPanel.Caption:='指定参数错误';
frmSendMsg.StatusPanel.Font.Color:=clRed;
end;
except
//ShowMessage('指定参数错误');
end;
try
if res=2273 then
begin
frmSendMsg.StatusPanel.Caption:='不能找到该IP:'+AddrBox.Text;
frmSendMsg.StatusPanel.Font.Color:=clRed;
end;
// ShowMessage('不能找到该IP:'+AddrBox.Text);
except
end;
try
if (res<>0)and(res<>87)and(res<>2273) then
begin
frmSendMsg.StatusPanel.Caption:='错误:'+IntToStr(res);
frmSendMsg.StatusPanel.Font.Color:=clRed;
&n