Jump to content

UDF Add fail in SciTe


Recommended Posts

Hello,

I try to add a new UDF to my AutoIT library, and it seems I fail. I started to work following the insturctions found on the wiki . 

I made an extra folder just next to my AutoIT folder, called ExtraUDF, and copied the file CUIAutomation2.au3 in it (I try to use this UDF for automating a program) then I run sciteconfig, set this folder up as User Include Folder, applied the changes, then run the calltip manager and got a msg when I tried to parse it. I attach a few pictures for better present the problem.

I think I miss something here, should i put anything else on the ExtraUDF folder? I dont think that the CallTip manager added the udf to scite, If I try to run it i get a msg saying that I Scite cant open the include file and naturally after that, It can't use the functions called from it.

Thank you for your help and insight as always! Please ask, if anything is fuzzy about the problem

 

AutoIT3 folders.PNG

ExtraUDF.PNG

SciteConfig1.PNG

SciteConfig2.PNG

Trial.PNG

Link to comment
Share on other sites

Thank you, I added the UIAWrappers.au3 already with no problems.

I'm reading junkew post about how to use it. Its a bit hard but not impossible to follow. I try to get somehandels on the controls the program is using with SimpleSpy or Inspectx64 version, but so far not so good.

once _UIA_setVar has set itslef to oP1,2 etc, shouldn't the above code _UIA_Action part do some given action? (I tried with click, but nothing so far)

Thank you for your help!

(code is from SimpleSpy)

#include <UIAWrappers.au3>
#include <EditConstants.au3>
#include <AutoItConstants.au3>
#include <GUIConstantsEx.au3>
#include <CUIAutomation2.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPI.au3>
#include <Misc.au3>

#AutoIt3Wrapper_UseX64

Opt("TrayIconDebug", 1)
Opt("MustDeclareVars", 1)

consolewrite("*** Some important settings you can find in " & @scriptdir & "\UIA.CFG ***" & @CRLF)
consolewrite("*** " & _UIA_getVersionInfoString() )
consolewrite("*** If logging is turned on you can find it here :" & _UIA_getVar("logFileName") & @CRLF)

_UIA_setVar("oP1","Title:=Program;controltype:=UIA_WindowControlTypeId;class:=Window")  ;Program
_UIA_setVar("oP2","Title:=;controltype:=UIA_CustomControlTypeId;class:=MainView")   ;
_UIA_setVar("oP3","Title:=;controltype:=UIA_CustomControlTypeId;class:=TileNavigationView") ;

;~ $oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_ImageControlTypeId", $treescope_subtree)
_UIA_setVar("oUIElement","Title:=;controltype:=UIA_ImageControlTypeId;class:=Image") ;ControlType:=UIA_ImageControlTypeId;classname:=Image")

;~ Actions split away from logical/technical definition above can come from configfiles

;~_UIA_Action("oP1","highlight")
_UIA_Action("oP1","click") ;setfocus
;~_UIA_Action("oP2","highlight")
_UIA_Action("oP2","click") ;setfocus
;~_UIA_Action("oP3","highlight")
_UIA_Action("oP3","click") ;setfocus

;~_UIA_action($oUIElement","highlight")
;~_UIA_action($oUIElement,"click")
;~_UIA_action("oUIElement","highlight")
;~_UIA_action("oUIElement","click")

 

Edited by SorryButImaNewbie
Link to comment
Share on other sites

Its a software my new company is developing, I try to make an automatic tester program, I'm now able to write code that click on the given coordinates where the controls should be (maxsizeing the window before), so I can technicly make it happen, but I would like to write one that finds the controls in the given window, for A) code don't needs to know coordinates of controls beforhand and B ) I would like to better myself in automatization with AutoIT :)

brb trying your proposed code changes with highlights

Edit: it highlights the softwarewindow and an additional control (language change options) and I think the windows startmenu? trying to look at them with SimpleSpy soon

Edit2: Ohh it should highlight an icon on a button btw :) at least the code I copied from simplespy was highlighted an icon

Edited by SorryButImaNewbie
Link to comment
Share on other sites

Yes, it was my first try, It only saw the main window, nothing else, no control, text, or pictures

Edit:

Then I tried SimpleSpy and Inspector, they seems to find all the relevant controls but I can't act upon their information yet (I don't know the handle or ID or something that I can use, maybe text alone, but that could be problematic). Thats my goal right now, make a click command on a control without mouseclick by found coordinates or handle or title or something. 

It seems a few button can't be found by Inspector/SimpleSpy (fleshy design I guess), but lucky for me these buttons have text or text and pic on them, which can be found, so I think i will be able to click on them in the future.

Edited by SorryButImaNewbie
Link to comment
Share on other sites

Link to comment
Share on other sites

Thank you Master LarsJ, I have that very thread open in my browser and to be honest its the source of like 75-85% of my work :)

Inspect (and SimpleSpy) was able to detect every control I will need for the automatization. The only bump is that two pretty important control can't be detected, but the text on them can, so I plan to click on the text, which should translate to a click on the button, right? (since the textbox is on the button or the pic is on the button)

Unfourtunetly, Inspect treeview isnt giving back as a straight forward "clean" view as with the Intel Example and I'm not that experienced (let say this is my second day of using it) with them.

Edit: I post a few pic with the Inspect results momentarly

Edit2: Attaching the returned values of Inspect x64 on an icon of the target software (sorry for the redout, but I have to follow regulations, I think its still usefull)

This is what I get back

InspectResultsOnIcon.PNG

Edited by SorryButImaNewbie
Link to comment
Share on other sites

If nothing else works then you may want to click with the usual MouseClick command. Calculate the bounding rectangle of the text control and make a MouseClick in the center of the rectangle. See here how to do it. Especially posts 17 - 22.

Link to comment
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
 Share

×
×
  • Create New...