Ver Mensaje Individual
  #2  
Antiguo 08-01-2004
jorch_yr jorch_yr is offline
Miembro
 
Registrado: ago 2003
Posts: 26
Reputación: 0
jorch_yr Va por buen camino
En la ayuda de M$ pone que la funcion se encuentra en SHELL32.DLL,
pero en mi Windowz98 no esta en esa DLL pero si en URL.DLL.
Desconozco como ira en otros sistemas Windows.

----------------------------------------------------------------------------------

procedure TForm1.Button1Click(Sender: TObject);

function FuncAvail(_dllname, _funcname: string; var _p: pointer): boolean;
{
Devuelve true si la funcion _funcname esta disponible en la DLL _dllname.
Si es asi, almacena en _p la direccion de la función.
}
var _lib: tHandle;
begin
Result := false;
if LoadLibrary(PChar(_dllname)) = 0 then exit;
_lib := GetModuleHandle(PChar(_dllname));
if _lib <> 0 then
begin
_p := GetProcAddress(_lib, PChar(_funcname));
if _p <> nil then Result := true;
end;
end;


var
InetIsOffline : function(dwFlags: DWORD): BOOL; stdcall;

begin
{ Ojo: 'InetIsOffline' debe de estar escrito con estas mayusculas y
minusculas.}
if FuncAvail('URL.DLL', 'InetIsOffline', @InetIsOffline) = true then
if InetIsOffLine(0) = true
then ShowMessage('No estas conectado')
else ShowMessage('Estas conectado!');
end;


(Texto estraido de Tmania Explorer Truco Numero 448 Saver si estamos conectado a internet)
Responder Con Cita