Detect connexion to internet under windows 2000 or XP

Hello,
I'm a beginner in Delphi 6 personnal and I don't know how detect a connexion
to internet
under windows 2000 or XP.

I know under windows 95 or 98, thanks to this:
**********
   Function Detection_Connexion : Boolean;
Var
 Reg: Treginifile;
 buff : integer;
Begin
 Reg:=TreginiFile.Create('');
 Reg.rootkey:=HKEY_LOCAL_MACHINE;
 Reg.OpenKey('System\CurrentControlSet\Services\RemoteAccess', False) ;
 Reg.ReadBinaryData('Remote Connection',buff,16);
 if buff = 1 then  Detection_Connexion:=True else
    Detection_Connexion:=False;
 Reg.CloseKey;
 Reg.Free;
End;
****************

But it doesn't work under xp or nt 2000.

Thank you for any help.

Tanplan