Al Christoph
2005-01-17 12:27:49 UTC
I'm using the following hunk of code in Delphi to try to insure user is
connected to net. Check and if not popup standard connect dialog to get
connection. The open and check seem to work fine. If I'm not connected the
GoOnline seems to wait a sec or two and pass right on ahead returning true.
Any suggestions would be appreciated. I don't expect delphi expertise here,
just am I doing all the necessary stuff checks.
if not inited then
begin
sHNet:=InternetOpen(pchar(url), INTERNET_OPEN_TYPE_PRECONFIG, nil,nil, 0);
inited:=sHNet<>nil;
end;
result:=false;
res:=0;
result:= WinINet.InternetGetConnectedState(@flags,res);
if result then exit;
if url[length(url)]<>#0 then url:=url + #0;
result:= WinInet.InternetGoOnline(pchar(url),hwndParent,0);
Regards,
Al
connected to net. Check and if not popup standard connect dialog to get
connection. The open and check seem to work fine. If I'm not connected the
GoOnline seems to wait a sec or two and pass right on ahead returning true.
Any suggestions would be appreciated. I don't expect delphi expertise here,
just am I doing all the necessary stuff checks.
if not inited then
begin
sHNet:=InternetOpen(pchar(url), INTERNET_OPEN_TYPE_PRECONFIG, nil,nil, 0);
inited:=sHNet<>nil;
end;
result:=false;
res:=0;
result:= WinINet.InternetGetConnectedState(@flags,res);
if result then exit;
if url[length(url)]<>#0 then url:=url + #0;
result:= WinInet.InternetGoOnline(pchar(url),hwndParent,0);
Regards,
Al