Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/26/2014 in all areas

  1. Automate all windows and browser applications with one UDF function library. Based on the microsoft automation API this library high level supports Recognition of conttrols from EDGE, Chrome, FF, Opera, Safari and Windows native apps Small testing framework to split object repository from coding away Introduction Quickstart - Getting started quickly Simple scripts With this module you can automate all applications/programs that support ui automation and/or accesibility api from microsoft you can recognize more controls than AutoIT can recognize "out of the box" you can use concepts from other testing frameworks like http://download.freedesktop.org/ldtp/doc/ldtp-tutorial.pdf http://safsdev.sourceforge.net/Default.htm coded ui testing from microsoft Some of those controls / applications are chrome browser (partly mainwindow has to be done with MSAA for navigating) chrome://accessibility in the adress bar of chrome or start with "--force-renderer-accessibility" silverlight controls Ribbon control controlbars of Excel/Word IE and FF browsers Windows Media Player Windows clock AFX .. controls (partly) .... Based on the initial AIO Object I now have made the interface file to work with objCreateInterface function which is in the latest beta's automate clicking and querying basic information It gives you a lot of basic information to be able to automate clicking, querying basic information where it goes further in certain situations than AutoIt is identifying Starting threads for background on the ui automation api of microsoft (not for starters) http://en.wikipedia.org/wiki/Microsoft_UI_Automation http://msdn.microsoft.com/en-us/library/ms747327.aspx Previous threads in general help/support Interface AutoItObject IUIAutomation ObjCreateInterface and struct tagPoint in method ElementFromPoint Be aware that API is not allways installed under XP/Vista see http://support.microsoft.com/kb/971513 Within Windows 7 and Windows 8 it should be preinstalled by default. Be aware on 32 and 64 bits way of running your script #AutoIt3Wrapper_UseX64=Y or N Basic example of usage / showing and retrieving the default information, will post multiple examples later Hover your mouse to an area of interest and press ctrl+w and information will be shown in the edit box of the form Simple spy demo (see simplespy.au3 or use latest ZIP attachment for latest version) Main features Recognize windows and html controls for the major browsers Logical and physical description for controls (UI mapping, Application map) Simple repository logic to abstract logical and physical descriptions Store Runtime Type Information in RTI. variables Rubberbanding/highlighting of objects Simple spy to help in making / identifying the physical description Support of regular expression(s) in identifying objects recognize objects on multiple properties supported properties: name ,title, automationid, classname, class, iaccessiblevalue, iaccessiblechildId, controltype, processid, acceleratorkey The actions provided so far "leftclick", "left", "click", "leftdoubleclick", "leftdouble", "doubleclick", _ "rightclick", "right", "rightdoubleclick", "rightdouble", _ "middleclick", "middle", "middledoubleclick", "middledouble", "mousemove", "movemouse" "setvalue","settextvalue" "setvalue using keys" "setValue using clipboard" "getvalue" "sendkeys", "enterstring", "type", "typetext" "invoke" "focus", "setfocus", "activate" "close" "move","setposition" "resize" "minimize", "maximize", "normal", "close", "exist", "exists" "searchcontext", "context" "highlight" "getobject","object" "attach" "capture","screenshot", "takescreenshot" "dump", "dumpthemall" "propertyvalue", "property" match on multiple properties like: name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl+F Support for 117 different properties see $UIA_propertiesSupportedArray in uiawrappers like for example title, regexptitle, class, regexpclass, iaccessiblevalue, iaccessiblechildid, name, accesskey, automationid, classname IAccessible, IAccessible2, ISimpleDom interfaces debuglogging to a file log.txt (no output in scitewindow) Examples Example 1 Iterating thru the different ways of representing the objects in the tree (#comment-1105548) Example 2 Finding the taskbar and clicking on the start menu button (#comment-1105680) Example 3 Clicking a litlle more and in the end displaying all items from the clock (thats not directly possible with AU3Info) (#comment-1108849) Example 4 that demonstrates the calculator Example 5 Automating chrome Example 6 Demonstrates all stuff within chrome to navigate html pages, find hyperlink, click hyperlink, find picture, click picture, enter data in inputbox Example 7 The chrome example modified to a firefox example Example 8 The other major browser Internet Explorer automated (made on Example 6 and 7) Example 9 Windows media player Example 10 Automating mach 3 (AFX windows and other hard to get recognized by AutoIT) Lot of links are broken due to forum upgrade just search for the text like "Example 11 Demonstrate Word, Notepad and Calculator actions" Example 11 Demonstrate Word, Notepad and Calculator actions ... Example 13 Details 1 about the right pane of the windows explorer Example 14 Details 2 about the right pane of the windows explorer Example 15 Details 3 about the right pane of the windows explorer Example 16 Details 4 about the right pane of the windows explorer Example 17 Details 5 about the right pane of the windows explorer WITH CACHING Example 18 Details 6 about the right pane of the windows explorer WITH VIRTUAL ITEMS Example 19 Eventhandling examples Example 20 Eventhandling examples Example 21a Eventhandling examples Internet Explorer Example 21b Eventhandling examples Internet Explorer Example 22 Eventhandling examples Follow focus Example 23 Eventhandling examples structure changed Example 24 Eventhandling examples IUIAutomationEventHandler Example 25 SAFEARRAYS Example 26 IACCESSIBLE / MSAA Example 27 IACCESSIBLE2 / MSAA Example 28 IACCESSIBLE / MSAA events Example 29 IACCESSIBLE2 events Example 30 ISimpleDOM Example 31 Notepad window move, maximize, minimize Example 32 Three browsers doing the same stuff with small differences in scripting only .. TODO Build recorder Enhance the spy with a nicer UI UI for the repository (now in the script with dot notation) Enhance mapping / identifying on multiple properties instead of 1 combined with index If speed becomes an issue use the caching logic of the MS UIA framework Add the other patterns later Generalize the concept of System Under Test of starting the SUT (for testing framework purposes) Remote running of scripts Fix issue on finding within dynamic context ... edit august 18th 2013 initial post Only zip files are needed to download , just unzip in 1 directory edit july 2016 Made V0_63 and examples works with AutoIt v3.3.14 Windows 10 tested Simple spy gives some basic code as a present Chrome latest versions seems to be having issues with IUIAutomation on tabs/buttons of mainwindow use MSAA for accessing tabsheets / buttons more cleanup to be in UDF style More comments in the source see changelog.txt for previous changes edit september 2017 All examples fixed for the IE, Firefox and Chrome browser Some small but essential fixes in UIAWrappers edit april 2018 Enhanced logic on fallback / dynamic search, still not perfect, to slow Retested with latest Chrome, FF, Edge and IE11 and some extensions to show how to get text from the webpage (examples 5,6,7) Some small bugfixes Some comments as given in forum incorporated edit may 2019 Speed enhancements on especially fallback searching UIA.CFG works now in a better way to turn on/off debug, highlighting, debug2file More stable and consistent behavior Internal cleanup and refactoring of bigger functions Checked with W10 (not tested on W7) Added some W10 properties Run with 3.3.14.5 on W10 UIA_V0_51.zip EXAMPLES_V0_5.zip UIA_V0_63.zip EXAMPLES_V0_63.zip UIA_V0_64.zip EXAMPLES_V0_64.zip EXAMPLES_V0_66.zip UIA_V0_66.zip EXAMPLES_V0_70.zip UIA_V0_70.zip
    1 point
  2. AZJIO

    Tools for Notepad++

    Place the Notepad ++ in the AutoIt3 folder Just replace the files in your Notepad++. The path must be "AutoIt3Notepad++" NotepadPlus.7z (v6.5.3 Ru, 4.9 Mb) shortcuts.xml, Contains commands: F5 - Start File (Alt + F5 - Setting) F6 - Start Script (ConsoleWrite) (Ctrl + F6 - Setting) Alt + F - Jump to function as a SciTE Alt+X - AutoIt3Wrapper (Ctrl + F6 - ConsoleWrite) Alt + Z - Tidy.exe %1 /refc /reel /bdir=C:AutoIt3BackUp Alt+i - Au3Info.exe Alt + R - ToolsRegExpRegExp.exe Alt + F1 (F2, F3) - HELP_AutoIt3.au3 Alt+F6 - Converter AU3 to BBcode Alt + F8 - list_var_funk.au3 Alt + Shift + A - txt2au3 Alt + G - JumpRegCMD Alt+Shift+D - Remove spaces Alt + K - Strip Comments Alt + L - Debugger Alt + F - JumpFunc Alt + N - CreateNewFile Alt + O - OpenToExplorer Alt + F7 - Renaming variables Ctrl + F7 - Include_Helper Ctrl + F9 - panel_function Ctrl + F12 - JumpToString Ctrl + 1 (2 ,3 ,4 ,5) - Set the color of the selected Ctrl + Shift + 1 (2 ,3 ,4 ,5) - Remove the color of the selected Ctrl + Shift + 0 - Remove the color of all selected langs.xml Added registered functions, operators and keywords themes AutoIt_Def.xml AutoIt+Zenburn.xml autoit.xml, batch.xml (for example enter "ms" and press "Enter") XBrackets.dll - sets closing brackets (disabled by default) NppExec.dll - Ctrl + F6 - for ConsoleWrite FunctionList.dll - List of functions NppSnippets.dll ScrollPastEOFUni.dll >JumpToString (Notepad++) >Include_Helper >Renaming variables >Debugger
    1 point
  3. FredAI

    Set Acl permissions UDF

    Hi. I've been working on this for a while. I think now it's good enough to post it here. Functions to do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc. Here's a good example to test: #include 'Permissions.au3' _InitiatePermissionResources() FileWrite(@ScriptDir&'test.txt','Test') Local $TI = TimerInit() Local $ret = _DenyAllAccess(@ScriptDir&'test.txt',$SE_FILE_OBJECT,@UserName) Local $TD = TimerDiff($TI) MsgBox(0,'','Deny all access to test.txt and take ownership:'&@CRLF&@CRLF& _ '_DenyAllAccesss return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() $ret = _GrantReadAccess(@ScriptDir&'test.txt',$SE_FILE_OBJECT,'Administrators') $TD = TimerDiff($TI) MsgBox(0,'','Grant everyone read access, all access to admins and system, and set the owner: Admins group'&@CRLF&@CRLF& _ '_GrantReadAccesss return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() $ret = _GrantAllAccess(@ScriptDir&'test.txt') $TD = TimerDiff($TI) MsgBox(0,'','Grant everyone access'&@CRLF&@CRLF& _ '_GrantAllAccesss return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() $ret = _CopyFullDacl(@ScriptDir&'test.txt',$SE_FILE_OBJECT,@ScriptDir) $TD = TimerDiff($TI) MsgBox(0,'','Restore all inherited permissions'&@CRLF&@CRLF& _ '_CopyFullDacl return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Local $aPerm[2][3] = [['Restricted',1,$GENERIC_ALL],['Users',1,$GENERIC_ALL]] $ret = _EditObjectPermissions(@ScriptDir&'test.txt',$aPerm) $TD = TimerDiff($TI) MsgBox(0,'','Add two granted access aces: Restricted and Users'&@CRLF&@CRLF& _ '_EditObjectPermissions return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Dim $aPerm[2][3] = [['Restricted',1,$GENERIC_READ],['Users',1,$GENERIC_READ]] $ret = _EditObjectPermissions(@ScriptDir&'test.txt',$aPerm) $TD = TimerDiff($TI) MsgBox(0,'','Give only read access to the Restricted and Users groups'&@CRLF&@CRLF& _ '_EditObjectPermissions return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Dim $aPerm[2][3] = [['Restricted',0,$GENERIC_ALL],['Users',0,$GENERIC_ALL]] $ret = _EditObjectPermissions(@ScriptDir&'test.txt',$aPerm) $TD = TimerDiff($TI) MsgBox(0,'','Deny access to the Restricted and Users groups'&@CRLF&@CRLF& _ '_EditObjectPermissions return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Local $Hndl = _Permissions_OpenProcess(@AutoItPID) Local $SDBefore = _GetObjectStringSecurityDescriptor($Hndl,$SE_KERNEL_OBJECT) Local $CODRet = _ClearObjectDacl($Hndl,$SE_KERNEL_OBJECT) Local $DARet = _DenyAllAccess($Hndl,$SE_KERNEL_OBJECT) Local $SDAfter = _GetObjectStringSecurityDescriptor($Hndl,$SE_KERNEL_OBJECT) $TD = Round(TimerDiff($TI),2) MsgBox(0,'', 'Deny everyone access to the current process:'&@CRLF&@CRLF& _ '@AutoItPID original security descriptor: '&@CRLF&$SDBefore&@CRLF&@CRLF& _ '_ClearObjectDacl return value: '&$CODRet&@CRLF&@CRLF& _ '_DenyAllAccess_ return value: '&$DARet&@CRLF&@CRLF& _ 'New @AutoItPID security descriptor: '&@CRLF& _ $SDAfter&@CRLF&@CRLF& 'Time taken: '&$TD&' miliseconds.') _Permissions_CloseHandle($Hndl) FileDelete(@ScriptDir&'test.txt') _ClosePermissionResources()I'm planning to add functions to deal with the Sacl in the future, even though I don't think it's very important. Edit: Let me know if you need an example for the registry. Updated: Fixed a bug in the _ClearObjectDacl function. I thought that adding a null DACL would work fine, but it causes problems later when adding a new DACL. Those who have downloaded, please update. Shoot! Now it wasn't clearing the DACL at all. Updated again. I think it's fixed now. Updated 9/11/2011 - Added the security descriptor functions and removed unnecessary constants. Updated 10/11/2011 - There were some functions missing in the index, and some parameters in the comments. Also removed the "MustDeclareVars" option. (About 50 total downloads before) Update 12/12/2011 - Added more functions: New Update 12/12/2011 - Missing declaration keywords in 3 constants. Sorry Update 16/12/2011 - Added support for all object types, including window and process handles. Added more functions, modified most of them, and removed one. Here's the new function list: Updated 22/2/2012.. This time I'm including SecurityConstants.au3 and FileConstants.au3 to prevent constants conflicts. Added a few more functions and fixed a few bugs. Also added the ability to include the inherited aces in the _EditObjectPermissions function. Now the permissions array can have four elements (optional). It will still work with three elements arrays though. The fourth element is intended to have the inheritance flag for the corresponding ace. Here's the new list of functions: 400 previous downloads Permissions.au3
    1 point
  4. When I get an ultrabook with multi-touch panel, the idea that using autoit to handle the multi-touch message comes out. Simple enough, but it can work normally. Enjoy it:) Files in attachment: MT_GESTURE.au3 WM_GESTURE.jpg MT_TOUCH.au3 WM_TOUCH.jpg MT_TOUCH _Color_Point_V2.au3 WM_TOUCH_V2.jpg Reference: WM_TOUCH message http://msdn.microsoft.com/en-us/library/windows/desktop/dd317341(v=vs.85).aspx WM_GESTURE message http://msdn.microsoft.com/en-us/library/windows/desktop/dd353242(v=vs.85).aspx GESTURE_TOUCH.zip
    1 point
  5. From experience, your signature needs an index or its own help file.
    1 point
  6. The screen resolution of your video card registry ; Проверяем харды на наличие OS, и при упехе вытаскиваем установки разрешения экрана из реестра $GUID = '' $XResolution = '' $YResolution = '' $VRefresh = '' For $i = 1 To $DrivesArr[0] $DrTp = DriveGetType($DrivesArr[$i] & '\') If $DrTp = 'Removable' Then $DrTp = 'Rem' If $DrivesArr[$i] <> 'A:' And $DrTp <> 'CDROM' And $DrTp <> 'Removable' And FileExists($DrivesArr[$i] & '\' & $Bootini & '\system32\config\system') Then Run(@ComSpec & ' /C REG LOAD HKLM\XP_SYSTEM ' & $DrivesArr[$i] & '\' & $Bootini & '\system32\config\system', '', @SW_HIDE) Sleep(100) $GUID = RegEnumKey("HKLM\XP_SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO", 2) ;$GUID = StringRegExpReplace($GUID, '(^.*)(\{.*\})(.*)$', '\2') $XResolution = RegRead('HKLM\XP_SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\' & $GUID & '\0000', 'DefaultSettings.XResolution') $YResolution = RegRead('HKLM\XP_SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\' & $GUID & '\0000', 'DefaultSettings.YResolution') $VRefresh = RegRead('HKLM\XP_SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\' & $GUID & '\0000', 'DefaultSettings.VRefresh') RunWait(@ComSpec & ' /C REG UNLOAD HKLM\XP_SYSTEM', '', @SW_HIDE) If $L = 1 Then FileWrite($filelog, 'получены параметры из реестра X=' & $XResolution & ', Y=' & $YResolution & ', F=' & $VRefresh & 'Гц' & @CRLF) ExitLoop EndIf Next ; Вытаскиваем разрешение экрана из потока данных $rnim = Run(@TempDir & '\DumpEDID.exe', @TempDir, @SW_HIDE, 2) $param = '' While 1 $param &= StdoutRead($rnim) If @error Then ExitLoop WEnd FileDelete(@TempDir & '\DumpEDID.exe') ; если нужен файл DumpEDID.exe, то закомментировать эту строку $resize = StringRegExpReplace($param, '(?s)(.*Maximum Resolution.*?)(\d{3,}) X (\d{3,}).*', '\2|\3') If $resize = '' Or @extended = 0 Or StringInStr($resize, @CRLF) Then $resize = StringRegExpReplace($param, '(?s)(.*\r\nImage Size.*?)(\d{2,}\S* X \d{2,}\S*).*', '\2') If $resize = '' Or @extended = 0 Or StringInStr($resize, @CRLF) Then $resize = '0|0' ; выход из скрипта если данные не получены Switch $resize Case '22.3 X 12.5' $resize = '1024|600' If $L = 1 Then FileWrite($filelog, 'детект образца 22.3 X 12.5: ' & $resize & @CRLF) ;Case '25.4 X 13.7' ; липовый пример как добавить дополнительную интерпретацию, скопировав две строки и указав данные. Добавлять можно сколько угодно. ; $resize='1280|800' ; Case Else ; Exit EndSwitch EndIf If $L = 1 Then FileWrite($filelog, 'DumpEDID выдал параметры: ' & $resize & @CRLF) Here's another calculation function: - >_SetCoor
    1 point
  7. MikahS

    Identifying a word

    I think everyone is waiting for your explanation of this image you are trying to mess around with.
    1 point
  8. _StringTitleCase might also work if there are apostrophes in the text. Note though, neither of these functions work well with Unicode text.
    1 point
  9. Try: #include <String.au3> ConsoleWrite(_StringProper("JOHN SMITH") & @CRLF) Br, UEZ
    1 point
×
×
  • Create New...