1 post in this topic
I've made a library, based on AutoItObject UDF with the goal of implementing getter and setter functionality and make it possible to define new object properties in as few steps as possible.
Thank you to @trancexx for getting me on the right track, and all users in Hooking into the IDispatch interface for the code to get me going.
If I've forgotten to add credit, please let me know
#include "AutoItObject_Internal.au3" $myCar = IDispatch() $myCar.make = 'Ford' $myCar.model = 'Mustang' $myCar.year = 1969 $myCar.__defineGetter('DisplayCar', DisplayCar) Func DisplayCar($oThis) Return 'A Beautiful ' & $oThis.parent.year & ' ' & $oThis.parent.make & ' ' & $oThis.parent.model EndFunc MsgBox(0, "", $myCar.DisplayCar) More examples: https://github.com/genius257/AutoIt-projects/tree/master/AutoItObject Internal/Examples
Edit2 (19th March 2017):
First of all, sorry about the lack of updates on this project. I always start too many projects and end up ignoring old projects, if I run into problems ^^'.
So I've started moving my AutoIt scripts to GitHub. I will still post the most recent script version here.
I'm trying to do a teletext viewer. Here is my code:
#include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> Local $sURL = "http://www.ndr.de/public/teletext/100_01.htm" Local $oIE = ObjCreate("Shell.Explorer.2") GUICreate("NDR Text", 494, 601) GUICtrlCreateObj($oIE, 0, 0, 513, 574) Local $idLabel_Number = GUICtrlCreateInput("", 2, 574, 60, 25, $ES_CENTER) GUICtrlSetFont(-1, 14) GUICtrlSetLimit(-1, 3) GUICtrlSetState(-1, $GUI_FOCUS) Local $idButton_OK = GUICtrlCreateButton("OK", 64, 574, 60, 25, $BS_DEFPUSHBUTTON) GUICtrlSetFont(-1, 14) $oIE.navigate($sURL) GUISetState(@SW_SHOW) ;Show GUI While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idButton_OK If GUICtrlRead($idLabel_Number) >= 100 And GUICtrlRead($idLabel_Number) < 900 Then $oIE.navigate("http://www.ndr.de/public/teletext/" & GUICtrlRead($idLabel_Number) & "_01.htm") EndIf GUICtrlSetState($idLabel_Number, $GUI_FOCUS) EndSwitch WEnd GUIDelete() It works but it doesn't look so good as shown direct in the InternetExplorer 11. Differences seen in the images I attached. I want to have the look like in the IE (first picture).
How to change my code?
How can I check if element is focused in Firefox using FF.au3 UDF?
This is my try:
I have prepared a function that checks if the object is focused:
After a lot of try/fails I inserted an alert box in order to display the object being compared.
Here is what I got
The focused object is: [object XULElement]
The object that I send for comparing is [object HTMLInputElement]
Why is that?
I'm playing a bit with the ScriptControl object using as base this example by @genius257.
here is a very simple try, ... but it fails. what I'm doing wrong?
#include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("website") Local $oForms = _IEFormGetCollection($oIE) For $oForm In $oForms MsgBox($MB_SYSTEMMODAL, "Form Info", $oForm.name) _IEImgClick($oForm.name, "Reserved.ReportViewerWebControl.axd?OpType=Resource&Version=12.0.5522.0&Name=Microsoft.ReportingServices.Rendering.HtmlRenderer.RendererResources.TogglePlus.gif", "src") Next I am having trouble clicking an image. Here is what I have tried.