Jump to content
DaleHohm

LibrariesIE.au3

Recommended Posts

DaleHohm

File Name: IE.au3

File Submitter: DaleHohm

File Submitted: 27 Mar 2013

File Category: Libraries

Title: Internet Explorer Automation UDF Library for AutoIt3

Filename: IE.au3

Description: A collection of functions for creating, attaching to, reading from and manipulating Internet Explorer

Author: DaleHohm

Version: T3.0-0

Last Update: 9/3/12

Requirements: AutoIt3 3.3.9 or higher

This version is checked into the development stream for the next AutoIt beta release, but will work with the most recently released V3.3.9.x beta.

I am releasing it here so that it can get some testing now and help some people with some of the issues it fixes in the realm of COM error handling (and "the WEND error").

This file will be removed when it is included in a public beta release.

Dale

  • Like 4

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
DaleHohm

Please test this IE.au3 include with the latest AutoIt beta release (3.3.9.x).

It takes advantage of COM errors no longer being fatal in the beta version and fixes the "WEND" error that some users have started experiencing in _IELoadWait in the past year or so.

It also contains some small bug fixes and one new enhancement (see base note).

Please discuss anything that needs to be discussed about it here.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
BrewManNH

This UDF still has the same bugs reported in #2320, the return values are wrong in certain cases.

If $f_wait Then
    _IELoadWait($o_object)
    Return SetError(@error, 0, -1)
EndIf

If _IELoadWait returns an error, the return value from this section is going to be wrong. The functions return -1 as a success value, and if you're not looking at the @Error value returned and only looking to the return value, you're not going to see that there was an error.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
DaleHohm

@BrewManNH, this is code checked in 6 months ago and unfortunately, I was unaware of the ticket you created 4 weeks ago.

That said, this is not a code bug (although there is an issue with the documentation) - it is working as designed and intended.

The special circumstance here is described in the Remarks for _IENavigate:

This function always returns a value of -1. This is because the navigate method has no useful return value and therefore nothing can be implied from it. You will need to employ other methods to determine success or failure of the navigation.

This is also true of the other functions you call out in the ticket.

You may not agree with my design choice, but I chose to have the functions always return -1 so that the user did not try to infer success or failure of the core function they were calling (like navigate, click or submit), regardless of the success or failure of the cascaded _IELoadWait . You can catch a problem with _IELoadWait by checking @error. I use -1 as a return value consistently in IE.au3 when there is an indeterminate return from a method call.

This is a day-one issue with the docs for these functions and they do need to be corrected to properly describe the behavior.

Thanks for drawing my attention to the ticket. I will update it.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
BrewManNH

But the functions return 0 for several conditions, they don't always return -1, which was my point.

If Not IsObj($o_object) Then
        __IEErrorNotify("Error", "__IENavigate", "$_IEStatus_InvalidDataType")
        Return SetError($_IEStatus_InvalidDataType, 1, 0) ; <<<<<<<<<<< Here it returns 0 when it encounters an error with the $o_object passed
    EndIf

Either it always needs to return -1 and tell the user to check @error, or correct the return for the _IELoadWait return value. The return values are inconsistent, and either the documentation needs correcting or the code does.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
DaleHohm

Ah, yes, I see your point. Thank-you.

If it errors out before even attempting the method, I am setting the return value to 0 (since the success of the method is NOT indeterminate). If we get as far as attempting the method, I set the return value to -1 (because the success of the method is indeterminate) even if the cascaded _IELoadWait fails.

This is the way I choose to have it work, so I will insure that this is also included in the helpfile.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
DaleHohm

So, back to the main reason I posted this...

I encourage people to try out this version with the beta - particularly those who have experienced "the WEND error" - and post any trouble you experience.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
tebennett

DaleHohm,

Thank you for making these updates to IE.au3. After I found the "Beta Run" menu; the script I have written and use at work has been processing through all of the inventory updates without issue.

My words cannot express how happy I am with this update. Sometimes I could go a full 12 minutes before the WEnd error message appears. I am pleased to report it has been an hour! The entire time I have been writing and troubleshooting the script I would have sworn it was:

* the external website we use to keep our inventory

* the internet filter / firewall between us and the external website

By the way; thank you for all of your posts and contributions on the AutoIt forums, been reading them and making corrections to my scripts. The DebugBar was a god send.

Thank you again,

Thomas E. Bennett

Edited by tebennett

Share this post


Link to post
Share on other sites
DougShields

Doh! I backed out from 3.3.8.1 to 3.3.6.1 a year ago due to an IE.au3 WEnd error on line 585 and finally got around to addressing it yesterday afternoon/this morning, just to find this thread an hour later. Timing is everything, as I really could have just kept waiting until the next release... :(

Anyway, my problems/fixes for 3.3.8.1 were :

  • __IEIsObjType deregisters the internal error handler while _IELoadWait is depending on it so I added a reference counter to __IEInternalErrorHandlerRegister / __IEInternalErrorHandlerDeRegister.
  • My underlying error ($IEComErrorScriptline = 585, $IEComErrorNumberHex = 80070005, $IEComErrorNumber = -2147024891, $IEComErrorWinDescription = Access is denied.) was treated as non-recoverable in __IEComErrorUnrecoverable, so I added a case to handle it as recoverable.
Reading the new version it looks like the new error handling and changes in __IEComErrorUnrecoverable effectively do the same things, so I expect it will work for me. I'll try actually testing the beta with my stuff to confirm (a 10000 line application control library that excercises IE/IE.au3 for ~45 minutes straight). If I really like the beta I might even put it on the Continuous Integration machine so we can get several runs every day until the next release comes out. :)

Underlying this... I cannot find any hint why $o_object.&#100;ocument.readyState is throwing the error rather than a meaningful state (like "uninitialized" perhaps). I can only confirm that $o_object.document is a valid HTMLDocument object, and that .readyState can go from valid to throwing this error to valid again in the span of a couple lines of AutoIT (i.e. breaking up line 574 into a $temp variable with 3 lines of code to build up the variable prior to WEnd, the code can fail on the .readyState=4 check even though the line before it succeeds on the .readyState="complete" check; with my changes and error notify turned on I can see the situation is usually recovered in 1 pass through the loop - i.e. ~100ms). Basically there is a very brief timing sensitive window where _IELoadWait can catch the HTMLDocument object with its pants down. In my case the app is basic form/submit stuff with postbacks and the occasional iFrame, so presumably IE is doing this while loading the new document into the window but I'm not going to deep dive IE's behaviour on this unless something else comes up.

Edited by DougShields

Share this post


Link to post
Share on other sites
DougShields

Not a com/WEnd error, but I'll mention this one as well... There is an issue in IE.au3 in 3.3.6.1 that does not appear to be addressed in the new beta file - a WinWait("x") _IEAttach("x","dialogbox") pair can fail to attach because IE displays the dialog box window before it contains an IE control (probably very OS and IE version specific). It is timing sensitive as it requires AutoIT to execute a fair bit of code faster than IE can add the control to the window, but ultimately the "Local $h_control = ControlGetHandle()" line can miss getting the control because IE has not prepared the control on the window yet. In my experience the failure rate is less than 1 in 30 for my current environment. I have worked around this in my own code by inserting a check/sleep to delay _IEAttach if IE is not ready. Vastly simplified (let's assume relevant paramters and error checking exist in the real code):

WinWait($sMyWindow) ; Wait for the dialog box window
If ControlGetHandle($sMyWindow,[IE stuff]) = "" Then Sleep() ; Check if the window contains an IE control and delay if it is missing
$oIEDlg=_IEAttach($sMyWindow, "dialogbox")
_IELoadWait($oIEDlg)

Not sure how to fix that without supporting a timeout on _IEAttach, as there is no way to tell for certain how long to wait before retrying/giving up. Perhaps a small 100ms/10x retry loop getting the control would not offend anyone if the window looks like an IE window.

Share this post


Link to post
Share on other sites
coffeeturtle

Thank you Dale Hohm for continuing to update this UDF!

If you get a chance, I was wondering if there was a way to harness the power of this UDF to create a script that will test an entire site (site collection) for any dead links?

I'm sorry in advance if this isn't the best place to post such a question, but I really could use an example script to build on. Some sites have scores of pages with an inestimable amount of links that should have been changed over the years. I wanted an in-house solution, if possible.

Thank you much!

Share this post


Link to post
Share on other sites
DaleHohm

Nope, not the right place for this. Use the Support Forum. Note - this would not be an enhancement to IE.au3, but simply a project using IE.au3 and perhaps INetGet* or WINHTTP.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
coffeeturtle

Thank you! I'm actually getting closer to a solution. But please know I don't think I could do this without your UDF!

Share this post


Link to post
Share on other sites
tuananh2701

$oIE = _IECreate("http://www.website.com", 0, 0, 1)

C:\Program Files (x86)\AutoIt3\Include\ie.au3 (3690) : ==> The requested action with this object has failed.:

Local $oTemp = $o_object.document

Local $oTemp = $o_object.document^ ERROR

Share this post


Link to post
Share on other sites
DaleHohm

Welcome to the forum, but hopefully your future posts are better ones.

First, you must know that you have not provided enough information for any type of analysis. You have left out all version information, omitted critical information written to the console and have provided no context for your code.

As well, I suspect that you are not running the version of AutoIt required to use this revised UDF since you seem to imply that your script aborts. The key to this revision is the 3.3.9 or higher version in which COM errors are no longer fatal.

If, after reviewing the above, you still have a problem, please open a topic in the Support forum.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
Iczer

is there some method :

to get path to image in the browser cache

to make image show itself on the page (IE in OS configured to not to not show images by default)

Share this post


Link to post
Share on other sites
DaleHohm

this is not the support forum.


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
ivan

File Name: IE.au3

File Submitter: DaleHohm

File Submitted: 27 Mar 2013

File Category: Libraries

Title: Internet Explorer Automation UDF Library for AutoIt3

Filename: IE.au3

Description: A collection of functions for creating, attaching to, reading from and manipulating Internet Explorer

Author: DaleHohm

Version: T3.0-0

Last Update: 9/3/12

Requirements: AutoIt3 3.3.9 or higher

This version is checked into the development stream for the next AutoIt beta release, but will work with the most recently released V3.3.9.x beta.

I am releasing it here so that it can get some testing now and help some people with some of the issues it fixes in the realm of COM error handling (and "the WEND error").

This file will be removed when it is included in a public beta release.

Dale

Thanks for posting this Dale.

I've got a couple of scripts that produce the wend error regularly, so I'll go ahead and test it out. I'll post the output should this occur.

Regards,

Ivan

Share this post


Link to post
Share on other sites
big_daddy

Dale - I've run into the same issue twice now where changing a selection on a <Select> object does not fire the onchange event in IE9. It took some searching, but I found a related issue/solution in another language and ported it to AutoIt. I think this may be a good enhancement for IE.au3 to check the browser version and manually dispatch the event.

>First issue, >second issue, detailed bug report

I think the solution would be as easy as:

If $f_fireEvent Then
    If $o_object.document.documentMode = 9 Then
        $o_Evt = $o_object.document.createEvent("HTMLEvents")
        $o_Evt.initEvent("change", True, False)
        $o_object.dispatchEvent($o_Evt)
    Else
        $o_object.fireEvent("onChange")
        $o_object.fireEvent("OnClick")
    EndIf
EndIf
Edited by big_daddy

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

  • Similar Content

    • MakzNovice
      By MakzNovice
      Hello Experts,
      I am working on modifying table data of a browser currently in IE (soon in FF)
      My sequence of operations:
      1. Activate Browser
      2. Get Browser table
      3. Modify data  in table
      4. Suppress any warning/error message from webpage
      5. Activate the Webpage again 
      6. Send {F11} key sequence twice to achieve some update without Updating form ( {F5})
       
      My problem is at Step 5, as it activates the wrong window ( last used application rather than my browser window)
      My code snippet for it as follows
      $bFoundWindow = False Local $aList = WinList("[REGEXPTITLE:(?i)(.*Internet Explorer.*)]") Local $hWND = 0 For $i = 1 To $aList[0][0] If False = $bFoundWindow And $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 1) Then WinActivate($aList[$i][1]) ; 1. Activate Browser window WinSetState ( $aList[$i][1], "", @SW_MAXIMIZE) $hWND = $aList[$i][1] $objEditIE = _IEAttach ($aList[$i][1], "hwnd") $oTitles = _IETagNameGetCollection($objEditIE, "TITLE") For $oTitle In $oTitles $sTitle = $oTitle.innerText If $sTitle = $searchString Then MsgBox(0,"APPLICATION Found", "Got Edit List Window", 1) $bFoundWindow = True ExitLoop EndIf Next EndIf Next If False = $bFoundWindow Then MsgBox(0,"Error","Please launch Edit window for updating values in Browser prior to script execution",10) Exit EndIf ; MY CODE HERE TO MODIFY TABLE ; 2. Get Browser table ; 3. Modify data  in table ; Check if message from webpage pop-up window exists if so click ok on it Local $nCounter = 0 Local $nMaxCounter = 5 while 1 If WinExists("Message from webpage","") Then ControlClick("Message from webpage","","Button1","primary",1) ;4. Suppress any warning/error message from webpage Else $nCounter = $nCounter + 1 Sleep(100) ;MsgBox(0,"Counter", $nCounter, 1) If $nCounter = $nMaxCounter Then ExitLoop EndIf WEnd ;5. Activate the Webpage again  WinActivate($hWND) ; have already tried WinActivate($aList[$i][1]) but no success ;6. Send {F11} key sequence twice to achieve some update without Updating form ( {F5}) Send("{F11}") WinActivate($hWND) ;WinActivate($aList[$i][1]) Sleep(100) Send("{F11}") Any support will be highly appreciated
    • MakzNovice
      By MakzNovice
      Hello Experts,
      I am working on custom application details of which I am unable to share.
      But here is statement of my problem, I have two IE windows one window with Title "Parent " and other with "TableEdit", but for some reason when I get WinList they are shown as 2 processes each. ( see attached image)
      Since my most important motive is to modify table data in 'TableEdit' I try to access the table in it
      My code snippet is 
      ***********************************************************************************************
      $searchString = "TableEdit"
      Local $aList = WinList("[REGEXPTITLE:(?i)(.*Internet Explorer.*)]")
      _ArrayDisplay($aList)
      For $i = 1 To $aList[0][0]
          If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
              ;MsgBox($MB_SYSTEMMODAL, "", "Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1])
              If 0 <> StringInStr($aList[$i][0],"TableEdit") Then
                  $objEditIE = _IEAttach ($aList[$i][1])
                  ExitLoop
              EndIf
          EndIf
      Next
      WinActivate($objEditIE)
      $oPageContentListFrame = _IEFrameGetObjByName($objEditIE, "iframe_1")
      $iNumFrames = @extended
      MsgBox(0,"Got pagecontent",@error) ; returns 3, indicating invalid data type
      MsgBox(0,"Number of Frame",$iNumFrames) ; returns 1, expected value is 1 
      ***********************************************************************************************
      and If I do code as below the return value is different
      $searchString = "TableEdit"
       $objEditIE = _IEAttach ($searchString, "title")
      WinActivate($objEditIE)
      $oPageContentListFrame = _IEFrameGetObjByName($objEditIE, "iframe_1")
      $iNumFrames = @extended
      MsgBox(0,"Got pagecontent",@error) ; returns 0
      MsgBox(0,"Number of Frame",$iNumFrames) ; returns 0. expected value is 1
      ***********************************************************************************************
      What is wrong with my code? 
      Why do I see two process each for IE for each window?
       
      WinListImage.bmp
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning everyone

      I was playing a little bit with "Screen Capture" UDF, and I was trying to make a "Window" capture, but, since I made a GUI which through I fire the event "Capture", my GUI is captured as well, and I don't want to
      This is the line of code that makes the capture:
       
      _ScreenCapture_CaptureWnd($strScreenCaptureFileName, $objActiveWindow, 0, 0, -1, -1, False) And these are the lines of code which select the "active" window:
       
      Local $objCurrentWindow = 9999 If _IsPressed("01") Then $objCurrentWindow = WinGetHandle("[ACTIVE]") If $objCurrentWindow <> $objMyGUI Then $objActiveWindow = $objCurrentWindow EndIf EndIf Sorry If I made stupid mistakes
      Thanks in advance.

      Francesco
    • kcvinu
      By kcvinu
      Hi all,
      I am playing with _GUICtrlButton_Create function. How can i change this button's (or the entire form's) font ?. The in-built GUICtrlSetFont function is not working even when i convert the control handle to control ID with _WinAPI_GetDlgCtrlID ( ) function.  Do i need to use CreateFont api finction and send WM_SETFONT message ? Or is there any other easy and safe ways to do this ?. Thanks in advance.
      Note : This window is created by CreateWindowEx function, not by GUICreate function. 
    • okolaris
      By okolaris
      Hey everyone,
      I thought I might share my little Language UDF plus the more powerful SciTE Tool to ship Strings from SciTE into the xml file. While I haven't had the time to fully adapt the small UDF to one of the big XML-UDFs the so called "Language Transmitter" that basically writes the XML file for you runs mostly on "XML DOM wrapper (COM)" by eltorro. The Transmitter should work with other XML-Language-UDFs depending on their encoding.
       
      First let's start with the UDF, there are two functions of interest: _LangInit($sFilePath) and s($sString) As you will have guessed, _LangInit($sFilePath) is called once to initialize the UDF and s($sString) is used to receive the string to your key. Plain and simple.
      Now to the actual "new" part, the Language Transmitter. It basically allows you to transfer a selected String from SciTE into a xml file. While doing so it will scan for AutoIt variables, macros etc. and parse the string to fit StringFormat(). It then saves the formatted string in the xml file and returns the formatted call into SciTE. If the selected string is already defined it will directly parse the key into SciTE. To change the default output file, you can either edit the ini-file in the @ScriptDir of the LanguageTransmitter.exe or press Alt+A on empty space again and keep clicking cancel/no until the Transmitter let's you select the current output file. Standard output is strings.xml in the current opened AutoIt Script.
      Example:
      ; given the line: MsgBox(16, 'Error', 'Error message') ; select 'Error' run the Transmitter follow the instructions, repeat with 'Error message'. Outcome (e.g.): MsgBox(16, s('Error'), s('Error_msg')) ; Variables and Macro example: $sString = "Value: " & $iValue & @CRLF & 'Another value: '& $iValue2 ; Select the full string including all AutoIt variables and macros etc. in SciTE and press Alt+A (default) to run the LanguageTransmitter ; follow the instructions and it will then paste a formatted string like that into SciTE: $sVar = StringFormat(s('Key'), $iValue, $iValue2) ; the correlating xml entry should look like that: ; <string name="Key">Value: %s\r\nAnother value: %s</string> ; as you can see @CRLF has been replaced with \r\n as well. If you are working on a project and want to directly add a string to the xml file just start the Language Transmitter without selecting any text, enter your string and a key.
      SetUp/Installation
      Examples
      Since xml files are required all examples can be found in the zip file. There are two examples, one includes a language selection interface.
      Language File Checker
      I added a script to check whether the xml file contains all required strings or even unnecessary strings.
       
      Hope you like my little helper!
       
      UDF - LanguageSupport.zip
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.