Jump to content
Fivewin Brasil

Verificar se o Internet Explorer Está ON/Off


kapiaba

Recommended Posts

Galera, como faço para Verificar se o Internet Explorer Está ON/Off??

Explico: No Windows 2003 Server, alguns administradores de rede, desligam o Internet Explorer e isso tem me causado problemas, principalmente com a FlexDocs, retornando erro de TOLEAUTO:NEW().

Gostaria de saber, se tem algum comando do xHarbour, que verifique se o Internet Explorer está OFF(desligado) e que eu possa mandar uma mensagem para o Usuário solicitar a ligação do mesmo, para inclusive, ele poder ver o certificado digital.

Agradeço de antemão qualquer ajuda.

Obg. abs.

Link to comment
Share on other sites

Senhores, pode me dizer se esta funcção está correta? Como não tenho windows 2003 server, não tenho como testar.

#include "FiveWin.ch"
 
PROCEDURE Main
 
   local oOLE, cHTML, cTEXT, lIeAtvo := .F.
 
   TRY
 
      oOLE := GetActiveObject( "InternetExplorer.Application" )
 
      lIeAtvo := .T.
 
   CATCH
 
      TRY
         oOLE := CreateObject( "InternetExplorer.Application" )
 
         lIeAtvo := .T.
 
      CATCH
 
         Alert( "ERROR! IE not avialable." )
 
      END
 
  END
 
  oOLE:Visible := .F.
  oOLE:Navigate("about:blank")
 
  IF lIeAtvo // := .T.
     ? [internet explore ativo]
  Endif
 
  /*
  //... checkpoint A
  oOLE:Document:Body:innerHTML := cHtml
  //... checkpoint B
  cHtml2 := oOLE:Document:Body:innerHTML
  memowrit("inet10.html",cHtml2)
  */
 
  oOle:quit()
 
RETURN

Obg. abs.

Link to comment
Share on other sites

o que vc quiz dizer com desligam, isso significa desinstalam?

Não tio, no windows 2003 server, o administrador pode "invisibilizar/desligar" o acesso para o usuário, ou seja, o usuário não consegue acionar o Internet explorer e nem o programa, mesmo ele estando lá instalado e bonitinho, mas sem acesso, comprende?

abs,

Link to comment
Share on other sites

Alessandro(aferra), fiz assim, mas o phoda é que não tenho la mierda del windows 2003 server para bloquer o Interente Explorer e ter certeza que vai funcionar... Que vida kruel... kkkkkkkkkkk, abs.



FUNCTION IeAivo( lIeAtvo )

LOCAL oOLE, cHTML, cTEXT //, lIeAtvo := .F.

TRY

oOLE := GetActiveObject( "InternetExplorer.Application" )

lIeAtvo := .T.

CATCH // Tenta de novo

TRY
oOLE := CreateObject( "InternetExplorer.Application" )

lIeAtvo := .T.

CATCH

//Alert( "ERROR! IE not avialable." )
lIeAtvo := .F.

END

END

oOLE:Visible := .F.
oOLE:Navigate("about:blank")

WHILE oOLE:Busy
HB_IDLESLEEP( 1 )
ENDDO

oOle:quit()

RETURN( lIeAtvo )

Link to comment
Share on other sites

Voce tem que ver o estado da variavel lIeAtvo

Se estiver falso a linha: oOLE:Visible := .F. vai dar erro pois o oOLE estará NIL se a lIeAtvo for igual a .F.

trate isso, mais ou menos assim: (NAO CONSEGUI TESTAR)

FUNCTION IeAivo( lIeAtvo )

LOCAL oOLE
, cHTML, cTEXT //, lIeAtvo := .F.

TRY

oOLE
:= GetActiveObject( "InternetExplorer.Application" )

lIeAtvo
:= .T.

CATCH
// Tenta de novo

TRY
oOLE
:= CreateObject( "InternetExplorer.Application" )

lIeAtvo
:= .T.

CATCH

//Alert( "ERROR! IE not avialable." )
lIeAtvo := .F.

END

END

If ! lIeAtvo

MsgStop("Nao foi possivel executar o Internet Explorer")

Return .f.

EndIf


oOLE
:Visible := .F.
oOLE:Navigate("about:blank")

WHILE oOLE
:Busy
HB_IDLESLEEP( 1 )
ENDDO

oOle
:quit()

RETURN
( lIeAtvo )

Alessandro(aferra), fiz assim, mas o phoda é que não tenho la mierda del windows 2003 server para bloquer o Interente Explorer e ter certeza que vai funcionar... Que vida kruel... kkkkkkkkkkk, abs.
FUNCTION IeAivo( lIeAtvo ) 
 
   LOCAL oOLE, cHTML, cTEXT  //, lIeAtvo := .F.
 
   TRY
 
      oOLE := GetActiveObject( "InternetExplorer.Application" )
 
      lIeAtvo := .T.
 
   CATCH  // Tenta de novo
 
      TRY
         oOLE := CreateObject( "InternetExplorer.Application" )
 
         lIeAtvo := .T.
 
      CATCH
 
         //Alert( "ERROR! IE not avialable." )
         lIeAtvo := .F.
 
      END
 
   END
 
   oOLE:Visible := .F.
   oOLE:Navigate("about:blank")
 
   WHILE oOLE:Busy
      HB_IDLESLEEP( 1 )
   ENDDO
 
   oOle:quit()
 
RETURN( lIeAtvo )
Link to comment
Share on other sites

consegui fazer no win 8 e deu certo a função que postou...o problema ainda é o teste no server 2003, porem tudo é windows então acredito que funcione tambem.

#include "FiveWin.ch"
 
PROCEDURE TestarIE()
 
   local oOLE, cHTML, cTEXT, lIeAtvo := .F.
 
   TRY
 
      oOLE := GetActiveObject( "InternetExplorer.Application" )
 
      lIeAtvo := .T.
 
   CATCH
 
      TRY
         oOLE := CreateObject( "InternetExplorer.Application" )
 
         lIeAtvo := .T.
 
      CATCH
 
         Alert( "ERROR! IE not avialable." )
 
      END
 
  END
 

  IF lIeAtvo // := .T.

		oOLE:Visible := .F.
		oOLE:Navigate("about:blank")
		oOle:quit()

		? [internet explore ativo]

  Endif
 
RETURN
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...