unit SimplePort1u1; interface // use "smport.vxd" driver with Win95/98, // copy file to "Windows\System" directory or to directory of your application // use "smport.sys" driver with WIN NT/2000, // copy file to "WinNT\SYSTEM32" directory or to directory of your application uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SmallPort, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; SmallPort1: TSmallPort; Button4: TButton; Label1: TLabel; procedure Button4Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button4Click(Sender: TObject); begin SmallPort1.Opened:=false; end; procedure TForm1.Button1Click(Sender: TObject); begin // if SmallPort1.Opened then // begin SmallPort1.Opened:=false; Button1.Caption:='Open Driver' end // else SmallPort1.Opened:=true; // if SmallPort1.Opened then Button1.Caption:='Close Driver'; SmallPort1.Opened:=true; end; procedure TForm1.Button2Click(Sender: TObject); begin SmallPort1.Port[$378]:=0; //SmallPort1.WriteByte[Parallel1]; end; procedure TForm1.Button3Click(Sender: TObject); begin SmallPort1.Port[$378]:=$ff; end; end.