kapiaba Posted July 16, 2014 Report Share Posted July 16, 2014 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. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 16, 2014 Author Report Share Posted July 16, 2014 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. Quote Link to comment Share on other sites More sharing options...
aferra Posted July 16, 2014 Report Share Posted July 16, 2014 o que vc quiz dizer com desligam, isso significa desinstalam? kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 16, 2014 Author Report Share Posted July 16, 2014 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, Quote Link to comment Share on other sites More sharing options...
aferra Posted July 16, 2014 Report Share Posted July 16, 2014 hummmm, não sei como fazer esse "invisibilizar/desligar" do navegador e ai não tenho como testa-lo, mas irei procurar e te aviso.... kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 16, 2014 Author Report Share Posted July 16, 2014 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 ) Quote Link to comment Share on other sites More sharing options...
emotta Posted July 16, 2014 Report Share Posted July 16, 2014 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 ) kapiaba 1 Quote Link to comment Share on other sites More sharing options...
aferra Posted July 17, 2014 Report Share Posted July 17, 2014 eu tenho para testar o server mas não sei como "sumir" com o ie para o usuario então não tenho como testar.. a não se que desinstale o ie, talvez dê certo...irei tentar e te falo. Quote Link to comment Share on other sites More sharing options...
aferra Posted July 17, 2014 Report Share Posted July 17, 2014 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 kapiaba 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.