opa belezinha Sec fio, eu vi num tópico q você respondeu ajudando o cara a criar um thread só q infelizmente acho q o tópico tomo delete depois dos problemas q deu no fórum... assim, você poderia me ensinar o básico pra se criar um thread? ou alguém que saiba ahahua seria assim, tipo pra criar um timeout em algo exemplo, executa algo, e se em 15 segundos não terminar o thread finaliza explicando melhor vo postar o codigo Tem a biblioteca Wininet não é? do IE, tem um esquema q da pra fazer download de arquivos, só q se não conecta, ou net ta lenta ela fica travada e não tem timeout fica travado ate conectar, se não conecta o programa já era só no control alt del auhah mas isso é um bug q é ate dito pela microsoft, então acho q criando um thread eu conseguiria fazer um timeout falando a respeito do bug: http://support.microsoft.com/kb/q176420/ função é essa uses Wininet; function DownloadURL(aUrl, Dest: String): Boolean; var hSession: HINTERNET; hService: HINTERNET; lpBuffer: array[0..1024 + 1] of Char; dwBytesRead: DWORD; Stream : TMemoryStream; begin Result := False; // hSession := InternetOpen( 'MyApp', INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0); hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); try if Assigned(hSession) then begin hService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, 0, 0); if Assigned(hService) then try Stream := TMemoryStream.Create; while True do begin dwBytesRead := 1024; InternetReadFile(hService, @lpBuffer, 1024, dwBytesRead); if dwBytesRead = 0 then break; lpBuffer[dwBytesRead] := #0; Stream.Write(lpBuffer, dwBytesRead); Application.ProcessMessages; end; Result := True; Stream.Position := 0; Stream.SaveToFile(Dest); finally InternetCloseHandle(hService); Stream.Free; end; end; finally InternetCloseHandle(hSession); end; end; hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); Até ai tudo bem, o problema ta em hService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, 0, 0); O programa inteiro fica congelado até que ele consiga abrir o URL Por thread é possivel fazer um timeout, sendo q eu defino algo como um timer sei lá q conta até X e se não passo desse InternetOpenURL então eu dou um InternetCloseHandle(hService) ou seja irá finalizar ali seria algo q em depois desse InternetOpenURL eu coloco vamos supor var done: boolean; .... hService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, 0, 0); if assigned(hservice) then begin done := true; .... e no thread eu faço q se em tanto tempo não tiver done = true então ele da um close no handle do InternetOpenURL alguém saberia me ajuda? abraços