Israel

Attachment blocking in IE

8 posts in this topic

Good afternoon

Is there anything that will block the attachment to the browser as shown in the function below?

oie = _IEAttach $ (WinGetHandle ("[Active]"), "hWnd")

Is returning me: -> IE.au3 T3.0-1 Warning function from _IEAttach, $ _IESTATUS_NoMatch

Thank you

Share this post


Link to post
Share on other sites



; wrong
oie = _IEAttach $ (WinGetHandle ("[Active]"), "hWnd")

; correct
$oie = _IEAttach(WinGetHandle ("[Active]"), "hWnd")

btw. are you sure WinGetHandle return to you correct window ?

try this

Local $hWindow = WinGetHandle ("[Active]")
ConsoleWrite(WinGetTitle($hWindow) & @CRLF)
$oie = _IEAttach($hWindow, "hWnd")

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

mLipok,

The syntax above was in error, but I saw that you understand the correct way. As for the code that sent me it is the same thing, only separated the functions. Does not work yet.

I was wondering if there is any blockage, as this same function connects in some applications, but does not connect in others.

Share this post


Link to post
Share on other sites

Did you notice what was in console :

ConsoleWrite(WinGetTitle($hWindow) & @CRLF)

??

Can you share here to the forum, this secret ;) information

 

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

jguinch,

For instance it did not work

Share this post


Link to post
Share on other sites

mLipok,

The result was:

Filas - Filas de Trabalho - Internet Explorer
--> IE.au3 T3.0-1 Warning from function _IEAttach, $_IESTATUS_NoMatch

>Exit code: 0    Time: 244.7

The name of my window and the error in not attach.

Share this post


Link to post
Share on other sites

and this:

#include <ie.au3>
#include <MsgBoxConstants.au3>

WinActivate('[REGEXPTITLE:.*?Internet Explorer]')
Local $hWindow = WinGetHandle("[Active]")
ConsoleWrite(WinGetTitle($hWindow) & @CRLF)
Local $oie = _IEAttach_TEST($hWindow, "hWnd")
If @error Then MsgBox($MB_ICONERROR, '_IEAttach_TEST', _
        '@error = ' & @error & @CRLF & '@extended = ' & @extended)

MsgBox(0, '', _IEDocReadHTML($oie))


Func _IEAttach_TEST($sString, $sMode = "title")
    $sMode = StringLower($sMode)
    Local $oShell = ObjCreate("Shell.Application")
    Local $oShellWindows = $oShell.Windows(); collection of all ShellWindows (IE and File Explorer)
    Local $iNotifyStatus, $bIsBrowser, $sTmp
    Local $bStatus
    For $oWindow In $oShellWindows
        $bIsBrowser = True
        ; Trap COM errors and turn off error notification
        $bStatus = __IEInternalErrorHandlerRegister()
        If Not $bStatus Then __IEConsoleWriteError("Warning", "_IEAttach", _
                "Cannot register internal error handler, cannot trap COM errors", _
                "Use _IEErrorHandlerRegister() to register a user error handler")
        ; Turn off error notification for internal processing
        $iNotifyStatus = _IEErrorNotify() ; save current error notify status
        _IEErrorNotify(False)

        ; Check conditions to verify that the object is a browser
        If $bIsBrowser Then
            $sTmp = $oWindow.type ; Is .type a valid property?
            If @error Then $bIsBrowser = False
        EndIf
        If $bIsBrowser Then
            $sTmp = $oWindow.document.title ; Does object have a .document and .title property?
            If @error Then $bIsBrowser = False
        EndIf

        ; restore error notify
        _IEErrorNotify($iNotifyStatus) ; restore notification status
        __IEInternalErrorHandlerDeRegister()
        ;------------------------------------------------------------------------------------------

        If $bIsBrowser Then
            Switch $sMode
                Case "hwnd"
                    If _IEPropertyGet($oWindow, "hwnd") = $sString Then
                        Return SetError($_IESTATUS_Success, 0, $oWindow)
                    EndIf
                Case Else
                    ; Invalid Mode
                    __IEConsoleWriteError("Error", "_IEAttach", "$_IESTATUS_InvalidValue", "Invalid Mode Specified")
                    Return SetError($_IESTATUS_InvalidValue, 2, 0)
            EndSwitch
        EndIf
    Next
    __IEConsoleWriteError("Warning", "_IEAttach", "$_IESTATUS_NoMatch")
    Return SetError($_IESTATUS_NoMatch, 1, 0)
EndFunc   ;==>_IEAttach_TEST

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now