Hello Mark,
Take a look at this:
~
#Region "Declarations"
Friend Declare Function InternetSetStatusCallback Lib "wininet.dll"
( _
ByVal hInternet As IntPtr, _
ByVal lpfnInternetCallback As INTERNET_STATUS_CALLBACK _
) As Integer
Friend Delegate Sub INTERNET_STATUS_CALLBACK( _
ByVal hInternet As IntPtr, _
ByRef dwContext As Integer, _
ByVal dwInternetStatus As InternetStatus, _
ByRef lpvStatusInformation As InternetState, _
ByVal dwStatusInformationLength As Integer _
)
Friend Enum InternetStatus
ResolvingName = 10
NameResolved = 11
ConnectingToServer = 20
ConnectedToServer = 21
SendingRequest = 30
RequestSent = 31
ReceivingResponse = 40
ResponseReceived = 41
CtlResponseReceived = 42
Prefetch = 43
ClosingConnection = 50
ConnectionClosed = 51
HandleCreated = 60
HandleClosing = 70
RequestComplete = 100
Redirect = 110
IntermediateResponse = 120
StateChange = 200
End Enum
Friend Enum InternetState
Connected = &H1
Disconnected = &H2
DisconnectedByUser = &H10
Idle = &H100
Busy = &H200
End Enum
#End Region
Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
MyBase.OnClick(e)
InternetSetStatusCallback(hInternet, AddressOf
InternetSetStatusCallback)
End Sub
Friend Sub InternetStatusCallback( _
ByVal hInternet As IntPtr, _
ByRef dwContext As Integer, _
ByVal dwInternetStatus As InternetStatus, _
ByRef lpvStatusInformation As InternetState, _
ByVal dwStatusInformationLength As Integer _
)
REM Handle callback
End Sub
~
It wasn't tested but should work.
Hope it will,
Roman