procedure TForm5.BitBtn2Click(Sender: TObject);<br>var<br> EventHandle: THandle;<br>begin<br> EventHandle := CreateEvent(nil, False, False, nil);<br> if EventHandle <> Null then<br> begin<br> if RasConnectionNotification(INVALID_HANDLE_VALUE, EventHandle,<br> RASCN_Connection or RASCN_Disconnection) = 0 then<br> begin<br> if WaitForSingleObject(EventHandle, INFINITE) = WAIT_OBJECT_0 then<br> begin<br> MessageDlg('Ok', mtInformation, [mbOK], 0);<br> end;<br> end;<br> CloseHandle(EventHandle);<br> end;<br>end;<br> <br>get ras.pas at http://delphi-jedi.org