Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/09/2020 in Posts

  1. LarsJ

    UI Automation UDFs

    To make it easier to maintain the UIA code, I've decided to split the code this way: This new thread is used for the actual UIA UDFs. Ie. the files stored in Includes folders and named UIA_*.au3 or UIAEH_*.au3. The UIASpy thread contains only code that is used directly in the UIASpy GUI, but not the UIA UDFs in this new thread. Using UIA Code contains only example code, but neither UIA UDFs nor UIASpy. UIA Events contains GUI code to detect events and it contains example code, but neither UIA UDFs nor UIASpy. This means that every time the code in the UDF files in this new thread is updated (eg. because of Windows 10 feature updates twice a year), you must install the files in the Includes folders in the other threads yourself. The easiest way is simply to copy all UDF files to the Includes folders. UDF Files CUIAutomation2.au3 - UIA constants for Windows 7 used in the first examples CUIAutomation2-a.au3 - The original UIA constants for Windows 7 from junkew's thread UIA_AccVars.au3 - Used to calculate properties of type VT_UNKNOWN, copied and modified from this thread UIA_Constants.au3 - UIA constants (copied from UIA header files) up to and including Windows 10 1809 UIA_ConstNames.au3 - Contains functions for converting UIA constants from values to names UIA_Functions.au3 - A collection of small utility functions UIA_Functions-a.au3 - First version of utility functions UIA_ObjectFromTag.au3 - Creates callback objects used in event handlers, copied and modified from this post by trancexx UIA_SafeArray.au3 - Constants and functions to handle safearrays, copied from this thread UIA_Variant.au3 - Constants and functions to handle variants, copied from this thread UIAEH_AutomationEventHandler.au3 - Implements the AutomationEventHandler UIAEH_FocusChangedEventHandler.au3 - Implements the FocusChangedEventHandler UIAEH_NotificationEventHandler.au3 - Implements the NotificationEventHandler, published in Windows 10 1709 UIAEH_PropertyChangedEventHandler.au3 - Implements the PropertyChangedEventHandler UIAEH_StructureChangedEventHandler.au3 - Implements the StructureChangedEventHandler Folders The UI Automation projects can be stored in a folder structure this way: UI Automation\ Code\ - Using UIA code Events\ - UIA events Spy tool\ - UIASpy.au3 UDFs\ - UDF files The UDF files must be installed in Includes\ in the first three folders. Threads UIASpy - UI Automation Spy Tool is a GUI tool that provides information about windows and controls and their interconnection and provides functionality to generate sample code. UIASpy is essential for creating UI Automation code. In Using UI Automation Code in AutoIt you can find and download examples and read information about using UIA code. UI Automation Events is about implementing event handlers and includes GUIs to detect events. IUIAutomation MS framework automate chrome, FF, IE, .... created by junkew August 2013 is the first AutoIt thread on UIA code. Zip-file The zip contains source code for the UDF files. You need AutoIt 3.3.12 or later. Tested on Windows XP, Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. UIAIncludes.7z
    1 point
  2. Answering my own question: #include <Misc.au3> If _Singleton("PrintFilePrinter", 1) = 0 Then MsgBox(48, "PrintFilePrinter", "PrintFilePrinter.exe is already running.") Exit EndIf
    1 point
  3. Ok found the problem. To solve it, follow those steps : 1- copy the UDF GuiEdit.au3 from the AutoIt\Include to your script folder 2- rename it GUIEditEX.au3 3- remove the read only property of the file 4- edit the file and replace in the Func _GUICtrlEdit_AppendText : _SendMessage by _SendMessageA 5- save the file 6- replace in your script the #include <GUIEdit.au3> by #include "GUIEditEX.au3" 7- run your script 8- enjoy Tested both on win7 and win10
    1 point
  4. Geckodriver is unable to communicate with Firefox via Marionette. You need to examine your profile to determine the correct marionette port number. You can find this under the About:Config page. Chances are that it's 2828. Once you've got the correct number, modify your _WD_Option line like this -- _WD_Option('DriverParams', '--log trace --marionette-port 2828') replacing the "2828" as needed to match the value you found earlier.
    1 point
  5. #include <Array.au3> Global $aArray[10] = ['A-1', 'A-2', 'B-1', 'B-2', 'C-1', 'C-2', 'D-1', 'D-2', 'CIAO-1', 'CIAO-2'] Global $aFinal[0] Combi("",-1,0,4) Func Combi($Str, $Pos, $Count, $MaxLen) if $Count = $MaxLen Then _ArrayAdd ($aFinal,$Str) Return EndIf For $i = $Pos+1 to UBound($aArray)-1 If StringInStr($Str,StringLeft ($aArray[$i],StringInStr($aArray[$i],"-"))) Then ContinueLoop Combi($Str & $aArray[$i] & " / ",$i,$Count+1,$MaxLen) Next EndFunc _ArrayDisplay ($aFinal) Ok, made a couple of changes to make it work with now a count instead of StrLen
    1 point
  6. Musashi

    MAKE HOST - (Moved)

    The renowned user alpines (from the DE-Forum) has written a program called passit2-1-1-0 that might help or give you some suggestions . Unfortunately infos and descriptions are written in German, but possibly translations using Google or DeepL are sufficient.
    1 point
  7. this person proved from the beginning that they were ungrateful for help or answers given, i dont know why all of you continued to try and help them then act surprised when they do the same thing to you that they did to me.
    1 point
  8. Some example code to test if concept still works used version 3.05.1 output.txt will contain the result (on my system about 30 seconds to analyze full screen which you probably normally should not do) Tweaking with scaling somewhere above 4.0 scaling gives some nice results certainly on black/white areas. However 8.0 is much to high. #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> local $TIF_FILENAME="c:\temp\test.tif" Local $TESS_PARAMS= $TIF_FILENAME & " output" Local $TESS_EXE=@ProgramFilesDir & "\Tesseract-OCR\tesseract.exe" local $TWorkDir="C:\temp\" Local $iScale = 8.0 ;1.0 is without any scaling SaveTiffImage() sleep(1000) ; Little time for saving the file AnalyzeImage() Func SaveTiffImage() _GDIPlus_Startup() Local Const $iW = @DesktopWidth , $iH = @DesktopHeight Local $hHBmp = _ScreenCapture_Capture("", 0, 0, $iW, $iH) ;create a GDI bitmap by capturing 1/16 of desktop Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap _WinAPI_DeleteObject($hHBmp) ;release GDI bitmap resource because not needed anymore Local $hBitmap_Scaled = _GDIPlus_ImageScale($hBitmap, $iScale, $iScale, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) ;scale image by 275% (magnify) ; Save resultant image _GDIPlus_ImageSaveToFile($hBitmap_Scaled, $TIF_FILENAME) ;cleanup resources _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hBitmap_Scaled) _GDIPlus_Shutdown() EndFunc ;==>Example func AnalyzeImage() Local $hTimer = TimerInit() ; Begin the timer and store the handle in a variable. shellexecutewait($TESS_EXE, $TESS_PARAMS, $TWorkDir) Local $fDiff = TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit. The variable we stored the TimerInit handlem is passed as the "handle" to TimerDiff. consolewrite( ($fDiff/1000) & "seconds passed") EndFunc
    1 point
  9. There is experimental feature available in some latest versions of AutoIt that allows you to create COM objects from modules without any demand on user to register anything. It would be something like this: ; Object identifiers Global Const $sCLSID_OleDocumentProperties = "{58968145-CF05-4341-995F-2EE093F6ABA3}" Global Const $IID_OleDocumentProperties = "{58968145-CF01-4341-995F-2EE093F6ABA3}" $sDll = "dsofile.dll" ; location and name of your dll $hDll = DllOpen($sDll) ; open it ; Experimenal feature. Try with newer versions of AutoIt $oObj = ObjCreate($sCLSID_OleDocumentProperties, $IID_OleDocumentProperties, $hDll) ; Check for errors and work with object ;...
    1 point
  10. hi guys i try to use this UDF with Sample but i have 2 problem . 1 when i push ESC the program not stop it 2. i force the stop and when listen a file .raw i listen it bad 1 second listen good 2 second stay mute
    0 points
×
×
  • Create New...