What are you trying to do?
I recently wrote some non-blocking code to download files via HTTP. I used this snippet as an example:
DLFile("http://dataphone.games.tucows.com/files/","FishTycoonSetup.exe")
Function DLFile(Url$,FileName$)
If File Exist(FileName$)=1 then Delete File FileName$
Load DLL "wininet.dll", 1
Call DLL 1,"InternetAttemptConnect",0
Con=Call DLL (1,"InternetCheckConnectionA",URL$,1)
If Con=0
Print "Internet connection not found!"
End
EndIf
INet = Call DLL (1,"InternetOpenA","media",0,"","",0)
URL = Call DLL (1,"InternetOpenUrlA",INet,URL$+FileName$,"",0,0,0)
#Constant HTTP_QUERY_CONTENT_LENGTH=5
Make MemBlock 2,16
BufferI as dword
BufferSize as dword
BufferI = Get MemBlock Ptr(2)
BufferSize = Make Memory(4)
*BufferSize = Get MemBlock Size(2)
QueryInfo = Call DLL (1,"HttpQueryInfoA",url,HTTP_QUERY_CONTENT_LENGTH,BufferI,BufferSize,0)
BufferLength=*BufferSize
FSize$=""
For F=1 to BufferLength : FSize$=FSize$+CHR$(MemBlock Byte(2,F-1)) : next F
FSize=Val(FSize$)
If FSize>1000 then FSize$=Str$(FSize/1024)+" kb"
Make Memblock 1,1024
Buffer = Get MemBlock Ptr(1)
Size = Make Memory(4)
Downloaded=0
Open to Write 1,FileName$
Repeat
Call DLL 1,"InternetReadFile",URL,Buffer,1024,Size
S=*Size
For I=0 to S-1 : Write Byte 1,Memblock Byte(1,I) : Next I
CLS
Print "Downloading: "+Url$+FileName$
If Timer()>SpeedTimer+1000
Speed=Downloaded-Downloaded2
Speed$=Str$((Speed)/1024)+" kb/s"
SpeedTimer=Timer()
Downloaded2=Downloaded
EndIf
Print "Speed : "+Speed$
If QueryInfo=1
Progress$=Str$((downloaded*100)/fsize)+"%"
Print "File Size : "+Fsize$
Print "Progress : "+Progress$
EndIf
Inc Downloaded,1024
Until S=0
Close File 1
Call DLL 1,"InternetCloseHandle",URL
Call DLL 1,"InternetCloseHandle",INet
Delete Memory Size
Delete MemBlock 1
Delete MemBlock 2
Delete DLL 1
EndFunction
Source