Jump to content

storme

Active Members
  • Posts

    859
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    storme got a reaction from Deathdn in _GetInstalledPath from Uninstall key in registry (V2.0 11/11/2013)   
    G'day All
    This is a script I put together some time ago (and recently updated) that is usefull when you don't know where on a system a particular program is installed.

    It uses the uninstall information so won't work with programs that don't appear in the uninstall list.
    If the programname isn't found (i.e. no registry key of that name) then the "DisplayName" key is searched for the specified program name.

    If you find any errors on your system please let me know. Specify what your system is(xp/vista/7 , 32/64) and what program you were trying to find.
     
    11/11/2013 V2.0
    Update for 64 bit
    I finally got back to this with a 64bit OS and found my last 64bit edit didn't work. So I spent a bit of time did a bit/lot of research and came up with the code below.
    The script will now search through the 3 areas (hklm, hklm64 and Wow6432Node) yes I know I shouldn't have to search Wow6432Node in theory.  However, I found a few programs that didn't appear in either of the other 2 so it's now included just in case.
    I also found that not all programs have an "uninstall" key so I've used "DisplayIcon" (which appears to be universal) to get the install location.  If anyone finds a problem with this please let me know.
     
    Of course any suggestions/bug fixes are most welcome.
    Func example()     Local $sDisplayName     ConsoleWrite(@CR & "Find : AutoItv3" & @CR)     ConsoleWrite(_GetInstalledPath("AutoItv3", $sDisplayName) & " @error = " & @error & @CR)     ConsoleWrite($sDisplayName & " @error = " & @error & @CR)     ConsoleWrite(@CR & "Find : Adobe" & @CR)     ConsoleWrite("Path = " & _GetInstalledPath("Adobe", $sDisplayName) & " @error = " & @error & @CR)     ConsoleWrite("desplayname = " & $sDisplayName & " @error = " & @error & @CR)     ConsoleWrite(@CR & "Find : Adobe reader" & @CR)     ConsoleWrite("Path = " & _GetInstalledPath("Adobe reader", $sDisplayName) & " @error = " & @error & @CR)     ConsoleWrite("desplayname = " & $sDisplayName & " @error = " & @error & @CR) EndFunc   ;==>example ; #FUNCTION# ==================================================================================================================== ; Name...........: _GetInstalledPath ; Description ...: Returns the installed path for specified program ; Syntax.........: GetInstalledPath($sProgamName) ; Parameters ....: $sProgamName    - Name of program to seaach for ;                                   - Must be exactly as it appears in the registry unless extended search is used ;                   $sDisplayName - Returns the "displayName" key from for the program (can be used to check you have the right program) ;                   $fExtendedSearchFlag - True - Search for $sProgamName in "DisplayName" Key ;                   $fSlidingSearch - True - Find $sProgamName anywhere in "DisplayName" Key ;                                    False - Must be exact match ; Return values .: Success     - returns the install path ;                            - ;                  Failure - 0 ;                  |@Error  - 1 = Unable to find entry in registry ;                  |@Error  - 2 = No "InstalledLocation" key ; Author ........: John Morrison aka Storm-E ; Remarks .......: V1.5 Added scan for $sProgamName in "DisplayName" Thanks to JFX for the idea ;                : V1.6 Fix for 64bit systems ;                : V2     Added      support for multiple paths (32,64&Wow6432Node) for uninstall key ;                 :                returns display name for the program (script breaking change) ;                 :                If the Uninstall key is not found it now uses the path from "DisplayIcon" key (AutoitV3 doesn't have an Uninstall Key) ; Related .......: ; Link ..........: ; Example .......: Yes ; AutoIT link ...; http://www.autoitscript.com/forum/topic/139761-getinstalledpath-from-uninstall-key-in-registry/ ; =============================================================================================================================== Func _GetInstalledPath($sProgamName, ByRef $sDisplayName, $fExtendedSearchFlag = True, $fSlidingSearch = True)     ;Using WMI : Why I diddn't use "Win32_Product" instead of the reg searching.     ;http://provincialtech.com/wordpress/2012/05/15/wmi-win32_product-vs-win32_addremoveprograms/     Local $asBasePath[3] = ["hklm\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\", "hklm64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\", "hklm\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"]     Local $sBasePath ; base for registry search     Local $sCurrentKey ; Holds current key during search     Local $iCurrentKeyIndex ; Index to current key     Local $iErrorCode = 0 ; Store return error code     Local $sInstalledPath = "" ; the found installed path     $iErrorCode = 0     For $sBasePath In $asBasePath         $sInstalledPath = RegRead($sBasePath & $sProgamName, "InstallLocation")         If @error = -1 Then             ;Unable To open "InstallLocation" key so try "DisplayIcon"             ;"DisplayIcon" is usually the main EXE so should be the install path             $sInstalledPath = RegRead($sBasePath & $sProgamName, "DisplayIcon")             If @error = -1 Then                 ; Unable to find path so give-up                 $iErrorCode = 2 ; Path Not found                 $sInstalledPath = ""                 $sDisplayName = ""             Else                 $sDisplayName = RegRead($sBasePath & $sProgamName, "DisplayName")                 $sInstalledPath = StringLeft($sInstalledPath, StringInStr($sInstalledPath, "\", 0, -1))             EndIf         EndIf         If $sInstalledPath <> "" Then             ExitLoop         EndIf     Next     If $sInstalledPath = "" Then         ; Didn't find path by direct key request so try a search         ;Key not found         $iErrorCode = 0;         If $fExtendedSearchFlag Then             For $sBasePath In $asBasePath                 $iCurrentKeyIndex = 1 ;reset for next run                 While $fExtendedSearchFlag                     $sCurrentKey = RegEnumKey($sBasePath, $iCurrentKeyIndex)                     If @error Then                         ;No keys left                         $iErrorCode = 1 ; Path Not found                         ExitLoop                     Else                         $sDisplayName = RegRead($sBasePath & $sCurrentKey, "DisplayName")                     EndIf                     If ($fSlidingSearch And StringInStr($sDisplayName, $sProgamName)) Or ($sDisplayName = $sProgamName) Then                         ;Program name found in DisplayName                         $sInstalledPath = RegRead($sBasePath & $sCurrentKey , "InstallLocation")                         If @error Then                             ;Unable To open "InstallLocation" key so try "DisplayIcon"                             ;"DisplayIcon" is usually the main EXE so should be the install path                             $sInstalledPath = RegRead($sBasePath & $sCurrentKey, "DisplayIcon")                             If @error = -1 Then                                 ; Unable to find path so give-up                                 $iErrorCode = 2 ; Path Not found                                 $sInstalledPath = ""                                 $sDisplayName = ""                             Else                                 $sInstalledPath = StringLeft($sInstalledPath, StringInStr($sInstalledPath, "\", 0, -1))                             EndIf                             ExitLoop                         EndIf                         ExitLoop                     EndIf                     $iCurrentKeyIndex += 1                 WEnd                 If $sInstalledPath <> "" Then                     ; Path found so stop looking                     ExitLoop                 EndIf             Next         Else             $sDisplayName = ""             Return SetError(1, 0, "") ; Path Not found         EndIf     Else         Return $sInstalledPath     EndIf     If $sInstalledPath = "" Then         ; program not found         $sDisplayName = ""         Return SetError($iErrorCode, 0, "")     Else         Return $sInstalledPath     EndIf EndFunc   ;==>_GetInstalledPath Have fun
    John Morrison
    aka
    Storm-E

    EDIT: Declares moved to top of function Thanks guinness
  2. Like
    storme got a reaction from AdamSteele in IUIAutomation MS framework automate chrome, FF, IE, ....   
    G'day Junkew
    There is so much that the Windows API can't access and it's long overdue that UIautomation was brought into AutoIt.
    I second Ascend4nt's comment about a "next-gen" Window info tool.  It'd be a great tool to explore this new way of Automating Windows.
    Like
    What I've always liked to see in the existing info tool is code samples to cut and paste.  In other words you select an item click a button and get a bit of code to cut and paste into your program.
    I've got many ideas about it that I won't expand on here unless you're interested.
    AND
    I'm not just asking for something as always I'm willing to help out in any way I can if you need any help.
    As you're the current expert how hard would it be to convert help file examples using standard syntax to UIautomation examples?
    Thanks for the effort!
    John Morrison
  3. Like
    storme got a reaction from faldo in Meet Remmanaut, the autoit remote administration tool   
    A3X are really just EXE files without the Autoit interpreter attacked.
    They won't help with multitasking but they will help with "False positive" virus detection and because they don't have the interpreter attached they are smaller.
    The structure I outlined lends itself to multitasking as multiple "Overseer/Tasker" can run simultaneously.  The "Scheduler" just needs to have a queue to know what is and isn't running.

    If you want others help then you should get the "white paper" / "structure" settled so that others can comment on it and help where they can. 
    I would love to see what you have in mind
    With out it people will just stand back and wait as they won't know where they can help you or even if they can help you. 
    Without clear plan you may not get much help until you have a almost finished system.
    Also a good plan means that you won't hit as many brick walls. as you have a map to follow....
    As I said I've been over a lot of the ground you will traverse.. I'm here to help.
  4. Like
    storme reacted to Melba23 in GUIListViewEx - Deprecated Version   
    storme,
    If you comment out those lines and drag between the ListView, the hidden column in the LH ListView (the native created one) will indeed become visible. This is a "feature" of native ListViews I discovered some time back and the various data insertion functions within the UDF have a $fRetainWidth parameter to prevent the column size being reset. All that section does is look for a drag event and then reset the 0 size of the relevant column if one occurs, thus making it visible for only a very short (a few ms) period.
    Do come back if you need any more help in integrating the UDF into your code.
    M23
  5. Like
    storme got a reaction from Xandy in Browse for Folder Dialog - Automation   
    G'day All
    I elsewhere and no one had an automation script for the "Browse for Folder" Dialog.
    If you don't know they are the dialog boxes called up by "FileSelectFolder" (in Autoit). They are used when you want the user to select a folder and want to ensure they select a folder that exists.

    It took me a while as I had to work out how to traverse a SysTreeView32 but it does what I want it to do now.
    Thanks to LurchMan for putting me on the right track.
    If you have any improvements or bugs please let me know.

    Target for test script (give it something to shoot at)

    MsgBox(0,"Selected Folder",FileSelectFolder ( "Just a test", "C:\"))
    Test Script (just selects "c:\Windows" in the target dialog)


    #include <Array.au3> #Include <GuiTreeView.au3> _BFF_SelectFolder("C:\windows") MsgBox(0, "_BFF_SelectFolder Result", "@error = " & @error) Exit ; #FUNCTION# ==================================================================================================================== ; Name...........: _BFF_SelectFolder ; Description ...: Automates the "Browse for Folder" Dialog so you can specify with a standard path ; Syntax.........: _BFF_SelectFolder($sPath[, $bClickOK = True]) ; Parameters ....: $sPath - Path to select in dialog ; $bClickOK - Optional: Click OK button. Default or True then click OK button ; Return values .: Success - returns True ; Failure - False ; |@Error - 1 = "Browse for Folder" dialog not found ; |@Error - 2 = Drive letter not in path ; |@Error - 3 = unable to locate my computer in tree ; |@Error - 4 = unable to locate directory ; Author ........: Storm-E aka John Morrison ; Modified.......: ; Remarks .......: Thanks to JohnOne for his fix for the clickitem delay ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _BFF_SelectFolder($sPath, $bClickOK = True) Local $asPath ; holds drive and folder section(s) Local $next Sleep(500) ;Get handle of "Browse for Folder" dialog Local $HWND = ControlGetHandle("Browse for Folder", "", "[CLASS:SysTreeView32; INSTANCE:1]") If @error Then Return SetError(1, 0, "") EndIf ; get first item - ya gota start somewhere :) Local $hCurrentItem = _GUICtrlTreeView_GetFirstItem($HWND) $hCurrentItem = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) ; items under desktop $asPath = StringSplit($sPath, "\") If $asPath[$asPath[0]] = "" Then $asPath[0] -= 1 ; eliminates blank entry if path has a trailng \ If StringRight($asPath[1], 1) <> ":" Then Return SetError(2, 0, "") EndIf ;Find My Computer Local $hCurrentItemChild = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) ; get items child While StringRight(_GUICtrlTreeView_GetText($HWND, $hCurrentItemChild), 2) <> ":)" $hCurrentItem = _GUICtrlTreeView_GetNextSibling($HWND, $hCurrentItem) ; Step to next item If $hCurrentItem = 0 Then ;Ran out of items so didn't find my computer Return SetError(3, 0, "") EndIf $hCurrentItemChild = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) WEnd _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem ;Find drive $hCurrentItem = $hCurrentItemChild While StringLeft(StringRight(_GUICtrlTreeView_GetText($HWND, $hCurrentItem), 3), 2) <> $asPath[1] $hCurrentItem = _GUICtrlTreeView_GetNextSibling($HWND, $hCurrentItem) ; Step to next item If $hCurrentItem = 0 Then ;Ran out of items so didn't find my computer Return SetError(3, 0, "") EndIf WEnd ;Needed for dialog to update _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem ;Find directory If $asPath[0] > 1 Then ; Check if only drive was specified For $item = 2 To $asPath[0] $hCurrentItem = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem While _GUICtrlTreeView_GetText($HWND, $hCurrentItem) <> $asPath[$item] $hCurrentItem = _GUICtrlTreeView_GetNextSibling($HWND, $hCurrentItem) ; Step to next item If $hCurrentItem = 0 Then ;Ran out of items so didn't find directory Return SetError(4, 0, "") EndIf WEnd _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem Next EndIf ;Needed for dialog to update _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem If $bClickOK Then ;Click OK button ControlClick("Browse for Folder", "", "[CLASS:Button; INSTANCE:1]") EndIf EndFunc ;==>_BFF_SelectFolder

    ; #FUNCTION# ==================================================================================================================== ; Name...........: _BFF_SelectFolder ; Description ...: Automates the "Browse for Folder" Dialog so you can specify with a standard path ; Syntax.........: _BFF_SelectFolder($sPath[, $bClickOK = True]) ; Parameters ....: $sPath - Path to select in dialog ; $bClickOK - Optional: Click OK button. Default or True then click OK button ; Return values .: Success - returns True ; Failure - False ; |@Error - 1 = "Browse for Folder" dialog not found ; |@Error - 2 = Drive letter not in path ; |@Error - 3 = unable to locate my computer in tree ; |@Error - 4 = unable to locate directory ; Author ........: Storm-E aka John Morrison ; Modified.......: ; Remarks .......: Thanks to JohnOne for his fix for the clickitem delay ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _BFF_SelectFolder($sPath, $bClickOK = True) Local $asPath ; holds drive and folder section(s) Local $next Sleep(500) ;Get handle of "Browse for Folder" dialog Local $HWND = ControlGetHandle("Browse for Folder", "", "[CLASS:SysTreeView32; INSTANCE:1]") If @error Then Return SetError(1, 0, "") EndIf ; get first item - ya gota start somewhere :) Local $hCurrentItem = _GUICtrlTreeView_GetFirstItem($HWND) $hCurrentItem = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) ; items under desktop $asPath = StringSplit($sPath, "\") If $asPath[$asPath[0]] = "" Then $asPath[0] -= 1 ; eliminates blank entry if path has a trailng \ If StringRight($asPath[1], 1) <> ":" Then Return SetError(2, 0, "") EndIf ;Find My Computer Local $hCurrentItemChild = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) ; get items child While StringRight(_GUICtrlTreeView_GetText($HWND, $hCurrentItemChild), 2) <> ":)" $hCurrentItem = _GUICtrlTreeView_GetNextSibling($HWND, $hCurrentItem) ; Step to next item If $hCurrentItem = 0 Then ;Ran out of items so didn't find my computer Return SetError(3, 0, "") EndIf $hCurrentItemChild = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) WEnd _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem ;Find drive $hCurrentItem = $hCurrentItemChild While StringLeft(StringRight(_GUICtrlTreeView_GetText($HWND, $hCurrentItem), 3), 2) <> $asPath[1] $hCurrentItem = _GUICtrlTreeView_GetNextSibling($HWND, $hCurrentItem) ; Step to next item If $hCurrentItem = 0 Then ;Ran out of items so didn't find my computer Return SetError(3, 0, "") EndIf WEnd ;Needed for dialog to update _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem ;Find directory If $asPath[0] > 1 Then ; Check if only drive was specified For $item = 2 To $asPath[0] $hCurrentItem = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem While _GUICtrlTreeView_GetText($HWND, $hCurrentItem) <> $asPath[$item] $hCurrentItem = _GUICtrlTreeView_GetNextSibling($HWND, $hCurrentItem) ; Step to next item If $hCurrentItem = 0 Then ;Ran out of items so didn't find directory Return SetError(4, 0, "") EndIf WEnd _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem Next EndIf ;Needed for dialog to update _GUICtrlTreeView_Expand($HWND, $hCurrentItem) _GUICtrlTreeView_ClickItem($HWND, $hCurrentItem) Do $next = _GUICtrlTreeView_GetFirstChild($HWND, $hCurrentItem) Until $next <> $hCurrentItem If $bClickOK Then ;Click OK button ControlClick("Browse for Folder", "", "[CLASS:Button; INSTANCE:1]") EndIf EndFunc ;==>_BFF_SelectFolder
    Hope it helps someone out.
    John Morrison

    Edit
    15/08/2011 - Fixed a Bug that stops routine from going beyond 2 levels deep.
    01/09/2011 - Fix from JohnOne to wait untill each level is navigated..THANKS!
  6. Like
    storme got a reaction from Michiel in LogonUser question, advapi32.dll   
    I may have found a solution for you.

    I played with your code for ages and couldn't get it to work.

    Then I did a search for "advapi32.dll" LogonUser and found http://www.autoitscript.com/forum/index.php?showtopic=14710

    Try this out and see if it works for you.

    #include <WinAPI.au3> $test = _checkUserCredentials("user", "password") MsgBox(64, "Username/password Valid", $test) Func _checkUserCredentials($sUserName, $sPassword, $sServer = '.') $stToken = DllStructCreate("int") Local $aRet = DllCall("advapi32.dll", "int", "LogonUser", _ "str", $sUserName, _ "str", $sServer, _ "str", $sPassword, _ "dword", 2, _ "dword", 0, _ "ptr", DllStructGetPtr($stToken)) If Not @error And $aRet[0] <> 0 Then Return True EndIf Return False EndFunc ;==>_checkUserCredentials
    Keep on coding
    John Morrison
  7. Like
    storme reacted to junkew in IUIAutomation MS framework automate chrome, FF, IE, ....   
    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
  8. Like
    storme reacted to Blinky in SPI Hardware Interface   
    Hi everyone,
    This is my special pet project.
    It is an example of how u can use autoit to control external devices.
    this script is made to comunicate with the MAX335 chip  using the SPI protocol via the LPT(printer) port
    the beauty of the MAX335 chip is that the Clock, Data_In and the Chip_Select pins can be directly connected to the LPT port without any external components, and the 12V and 5V directly from an ATX PC power suply.
    aditionaly i made a custom GUI with CommandFusion instaled on an Android Tablet that sends TCP commands to an Autoit TCP server that controls three dasy chained MAX335 chips that totals 24 independent NO switches
    this script works perfectly for me
    i just finished this project and i think i will make an UDF including more SPI devices
    $DLLFileAndPath = @ScriptDir & "/inpout32.dll" Global $335_device_number=3 ;number of daisy chained chips Global $335_clock_bit=0 ;bit number for LPT pin 1 in the control Register of the LPT port(where i connected the CLK pin on te MAX335) Global $335_cs_bit=4;bit number for LPT pin 6 in the data Register of the LPT port(where i connected the CS pin on te MAX335) Global $335_data_in_bit=7;bit number for LPT pin 9 in the data Register of the LPT port(where i connected the DI pin on te MAX335) Global $clock_delay=1;this limits the clock speed but it works fine with 0 ;the ini file will be created and will keep the MAX335 pins statuses For $i=0 To $335_device_number*8-1 Step 1 IniWrite("355_buffer.ini","present_data",$i,"0") Next set_max335_output(2,3,1) ; this will activate switch 2 on device 3 on the daisy chain Func set_max335_output($output_no,$device_no,$status) $bit_no=($device_no-1)*8+$output_no-1 ; get the exact bit number of the switch IniWrite("355_buffer.ini","present_data",$bit_no,$status); whrite it to the buffer ;this part is where the SPI protocol begins set_control_bit($335_clock_bit,1); drop CLK set_data_bit($335_cs_bit,0) ;activate CS Sleep($clock_delay) For $i=$335_device_number*8-1 To 0 Step -1; start writing from buffer MostSignificantByte first $data=IniRead("355_buffer.ini","present_data",$i,"0") set_data_bit($335_data_in_bit,$data) ; set data bit value set_control_bit($335_clock_bit,0) ;raise CLK Sleep($clock_delay) set_control_bit($335_clock_bit,1); drop CLK Sleep($clock_delay) Next set_data_bit($335_cs_bit,1);deactivate CS EndFunc Func set_data_bit($bit,$stat=-1) ; it will write the value of the bit in the data reg of the LPT port $y= DllCall($DLLFileAndPath, "int", "Inp32", "int", "0x378") $bits=dec_to_bin($y[0]) If $stat = -1 Then If $bits[$bit]=0 Then $bits[$bit]=1 Else $bits[$bit]=0 EndIf $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x378", "int", $bcd) Return 1 Else If $bits[$bit]<>$stat Then $bits[$bit]=$stat $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x378", "int", $bcd) Return 1 Else Return 2 EndIf EndIf EndFunc Func set_control_bit($bit,$stat=-1); it will write the value of the bit in the control reg of the LPT port $y= DllCall($DLLFileAndPath, "int", "Inp32", "int", "0x37a") $bits=dec_to_bin($y[0]) If $stat = -1 Then If $bits[$bit]=0 Then $bits[$bit]=1 Else $bits[$bit]=0 EndIf $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x37a", "int", $bcd) Return 1 Else If $bits[$bit]<>$stat Then $bits[$bit]=$stat $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x37a", "int", $bcd) Return 1 Else Return 2 EndIf EndIf EndFunc Func dec_to_bin($dec) Local $bit_array[8] If $dec > 255 Then SetError(1,1,-1) If $dec < 0 Then SetError(2,1,-1) For $i=7 To 0 Step -1 If $dec >= 2^$i Then $bit_array[$i] = 1 $dec=$dec-2^$i Else $bit_array[$i] = 0 EndIf Next Return $bit_array EndFunc Func bin_to_dec($bit_array) If IsArray($bit_array) Then If UBound($bit_array) = 8 Then $dec=0 For $i=7 To 0 Step -1 $dec = $bit_array[$i]*(2^$i)+$dec Next Else SetError(2,1,-1) EndIf Else SetError(1,1,-1) EndIf Return $dec EndFunc
  9. Like
    storme got a reaction from rich2323 in FileHippo Download and retrieve version V2.13   
    I've just had a look and yes with the update the pages have changed.
    I'll have a look and see what needs to be changed.  Hopefully not too much.
    Stay tuned...
  10. Like
    storme got a reaction from TheSaint in Web Pad (update)   
    Great idea!
    My replies even when short take ages so I've lost MANY replies then either posted some 1/2 baked answer or just given up.
    So I've started using Word, which is an overkill and it doesn't have nifty Code & link buttons.
    Thanks for sharing!
    John Morrison
  11. Like
    storme got a reaction from 0xdefea7 in AutoIt and Malware: Compile or just run scripts with AutoIt3.exe?   
    My experience "in the wild" with home pcs and having to deal with multiple Antivirus products with multiple configurations is you can't trust them not to kill AutoIt programs.
    As you (unlike I) have control of your environment,
    Why not install "AutoIt3.exe" somewhere permanently on your computers.
    Then associate "a3x" with "AutoIt3.exe".
    That way you don't have to bundle AutoIt3 with everything, you avoid the possibility of false positives completely and the AutoIt program (a3x) isn't plain text visible.
    Just my 2c worth.
    John Morrison
  12. Like
    storme reacted to BuckMaster in Form Builder beta   
    Update v1.0.6

    Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid.
    I don’t have a help file made as of now so I am going to explain all of the functionality in this post
    - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4
    - The script no longer recompiles on every change but instead inserts changes into the script
    - Form Builder no longer cares about Event mode or GuiGetMsg mode
    - No more .gui files, you now edit .au3 scripts directly
    - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations.
    - Script output console is now at the bottom in script mode
    - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys
    - All restrictions to editing the script have been removed
    - GDI+ and Graphic editors removed
    - Cleanup of script, stability greatly increased
    - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few)
    - Multiple scripts can be open
    - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified
    - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them
    - GUI Menu controls cannot be created as of now but will be rendered in the editor
    - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes
    - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts
    - Undo and Redo actions do not work for controls that have no control handle
    - The Treeview now works as a Go to function for controls and functions in script mode
    - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls
    - Treeview context menu reworked, much more responsive
    - Unicode support added File -> Encoding -> UTF-8
    - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say
    - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes
    - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local
    - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file,
      Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index
    - Added current script line, column, and selection length in the bottom left
    - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found
    - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu
    - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract
    - Form Builder Settings redone
    - Bugs with submitting data and control selection have been fixed
    - Fixed problems with frequently called repetitive functions causing issues with large scripts
    - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed
    Update v1.0.7
    - Help File Look-up hotkey changed to Ctrl+B
    - Replace hotkey changed to Ctrl+H
    - Changes to $SCN_MODIFIED so only text events are notified
    - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line
    - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark
    - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark
    - Allows you to change foreground and background colors of Bookmarks
    - Added F2 hotkey for Next Bookmark
    - Added Shift+F2 hotkey for Previous Bookmark
    - Fixed a bug that made it so script annotation did not show up for some people
    - Script errors and warnings now add a Bookmark on each line
    - Ctrl+E hotkey added to clear all Bookmarks and Annotations
    - Minor GUI tweaks
    - Fixed a bug with the GUI Style undo action
    - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected
    - F4 Hotkey no longer switches modes, switching modes is now F10
    - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console
    - Shift+F4 Hotkey added to toggle previous error or warning message
    - Shift+F5 Hotkey added to clear script output
    - Ctrl+F5 Hotkey added as SyntaxCheck Prod
    - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning
    - Language Select Menu Added Settings -> Lanugage
    - Icons added to main menu
    - Languages added to all new menu items and msgbox's
    - Language Files updated for new data
    - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ]
    - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected
    - Added redo button next to undo button
    - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels
    Update v1.0.8
    - Somehow a main function got deleted causing the script to crash on some changes
    - Fixed some issues with updating Languages
     


    Hotkeys
    Ctrl + N              - New Blank Script
    Ctrl + G              - New GUI Script
    Ctrl + O              - Open Script
    Ctrl + Shift + S   - Save As
    Ctrl + S              - Save
    Esc                    - Close Open Script
    Alt + F4              - Exit
    Ctrl + Z              - Undo
    Ctrl + Y              - Redo
    Ctrl + X              - Cut
    Ctrl + C              - Copy
    Ctrl + V              - Paste
    Ctrl + A              - Select All
    Ctrl + W             - Clear inline script annotation
    Ctrl + E              - Clear inline script annotation and bookmarks
    Ctrl + F              - Find
    Ctrl + F3            - Find Next
    Shift + F3           - Find Previous (doesn’t work yet)
    Ctrl + B              - Help File Lookup
    F5                      - Go
    Alt + F5             - Beta Run
    F7                     - Build
    Ctrl + F7            - Compile
    F11                    - Full screen
    F8                     - Toggle Show/Hide Script Output
    Ctrl + I               - Open Include
    Ctrl + H             - Replace
    F1                     - AutoIt Help File
    Ctrl + D             - Duplicate Control
    Delete               - Delete Control
    Ctrl + Shift + 8   - Toggle Show/Hide Script Whitespace
    Ctrl + Shift + 9   - Toggle Show/Hide Script EOL characters
    Ctrl                    - GUI Mode multicontrol selection
    F10                     - Switch Modes
    F4                     - Next Message
    Shift+F4            - Previous Message
    Shift+F5            - Clear Output
    Ctrl+M               - Add Bookmark
    F2                     - Next Bookmark
    Shift+F2            - Previous Bookmark
    Basic GUI Mode How To

    Create a Control
        - click a control on the left
        - click in the GUI you wish to add the control
          Left Click: Click and drag to auto resize the control
          Right Click: Creates the control at a standard size
    Select a Control
        - click inside the control or select it in the treeview
    Change a controls Data
        - First select the control
        - modify the controls data on the right, press enter to submit changes
          state, cursor, font and resizing update when you change the data
        - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly
          ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20)
          ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20)
          ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20)
    Applying an Image to a control
        - select a control
        - control styles must be applied to some controls before adding an image
        - click the ... button next to the Image input in the Control Properties area in the bottom right
        - select the image you want to display, allows jpg, bmp, gif, ico and dll files
        - selecting a dll will open another prompt to choose which resource to display
    Control Grouping
        - multiple controls must be selected
        - press the group controls button
        - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode
    I only have a couple odds and ends to finish up before everything should be complete,
    I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things,
    eventually I want to try to add all of the UDF controls as well.
    If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say.
    I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script.

    Please post any comments, problems or suggestions,
        BuckMaster


    * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care.
    Form Builder Source.zip
    Form Builder.zip
  13. Like
    storme got a reaction from Decipher in _MultiSiteDownload FileHippo, PortableApp, etc   
    G'day All

    At the moment this is a a place holder for the code that will follow.

    Purpose:
    A Central function _MultiSiteDownload that will download programs/updates/etc from multiple file sites.
    Behind this funciton will be a UDF for each site (eg "_PortableApp_Download", "_FileHippoDownload") that can be split off if your project only needs to download from one of these sites.)


    Use:
    Add to your projects that use 3rd party tools so they can be downloaded when needed.

    Existing code links
    FileHippo

    Portableapps
    /page__st__20#entry1008033
    SourceForge
    /page__st__20#entry918460
    Download.com
    /page__st__20#entry918356

    The only one I can vouch for at the moment is teh filehippo and portableapps downloader. The rest I'll have to test to make sure they are still working. When I have I'll move then to this tread.

    If you have any code to add to the collection please post and I'll add it.

    Onward and upward
    John Morrison
  14. Like
    storme reacted to ISI360 in ISN AutoIt Studio [old thread]   
    Hi!
    Today I want to show you my current AutoIt project: The ISN AutoIt Studio.
     

     
    The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt!
    It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!!
    Here are some screenshots:







    Here some higlights:
     
    -> easy to create/manage/public your AutoIt-projects!
    ->integrated GUI-Editor (ISN Form Studio 2)
    ->integrated - file & projectmanager
    ->auto backupfunction for your Projects
    ->extendable with plugins!
    ->available in several languages
    ->trophies
    ->Syntax highlighting /Autocomplete / Intelisense
    ->Dynamic Script
    ->detailed overview of the project (total working hours, total size...)
    And much more!!!
    -> -> Click here to download ISN AutoIt Studio <- <-
    Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1
    For more information visit my Homepage: https://www.isnetwork.at
     
    So….have fun with ISN AutoIt Studio!
     
     
    PS: Sorry for my bad English! ^^
×
×
  • Create New...