⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipadddialogeditor.pas

📁 IP输入框
💻 PAS
字号:
// email zayin@pdq.net
// Copyright 1999 Fire and Safety International
//
// This source is freeware.
// Do with it as you like. I offer no warranty or guarantee. Enjoy.

unit IPAddDialogEditor;

interface

uses Windows,SysUtils,Classes,Graphics,Forms,Controls,StdCtrls,Buttons,ExtCtrls,
     ComCtrls,Commctrl;

type
  TIPEditDialog = class(TForm)
    OKBtn: TButton;
    CancelBtn: TButton;
    Bevel1: TBevel;
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure OKBtnClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure CancelBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    ipEdit:HWND;
    ipAddress:integer;
  end;

var
  IPEditDialog: TIPEditDialog;

implementation

{$R *.DFM}

procedure TIPEditDialog.FormCreate(Sender: TObject);
begin
 ipAddress:=MAKEIPADDRESS(196,197,198,199);           //just testing
 InitCommonControl(ICC_INTERNET_CLASSES);
 ipEdit:=CreateWindow(WC_IPADDRESS,nil,WS_CHILD or WS_VISIBLE,91,88,130,23,self.Handle,0,
                      hInstance,nil);
end;

procedure TIPEditDialog.OKBtnClick(Sender: TObject);
begin
 SendMessage(ipEdit,IPM_GETADDRESS,0,longint(@ipAddress));
 if ipAddress = 0 then
  begin
   beep;
   SendMessage(ipEdit,IPM_SETFOCUS,0,0);                //select the first field
   modalResult:=mrNone;
  end
 else
  Close;
end;

procedure TIPEditDialog.FormShow(Sender: TObject);
begin
 SendMessage(ipEdit,IPM_SETADDRESS,0,ipAddress);        //show the current address
 SendMessage(ipEdit,IPM_SETFOCUS,0,0);                  //select the first field
end;

procedure TIPEditDialog.CancelBtnClick(Sender: TObject);
begin
 Close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -