Sending data via printerport with Delphi 2.

I am trying to send en receive data via the parallel port with Delphi 2.
But encounter two problems:
1. How can I send data en get info from this port?
2. Is there a possible way that Windows 95 is knowing that I am NOT using a
printer on that port?

For example in Turbo Pascal I had these code:

VAR
device_no : BYTE;      {code 0 =lpt1, 1=lpt2}
FUNCTION get_lpt_status: BYTE;
VAR
reg          : registers;
BEGIN
WITH reg DO
BEGIN
ah := $2;
dx := device_no; INTR($17,reg);
get_lpt_status := ah;
END; {with}
END; {get_lpt_status}

PROCEDURE lpt_send(code: BYTE);
VAR
reg          : registers;
BEGIN
WITH reg DO
BEGIN
WHILE ((get_lpt_status AND $80) = 0);
ah := $0;
al := code;
dx := device_no;
INTR($17,reg);
END; {with}
END; {lpt_send}