Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/18/2013 in all areas

  1. JLogan3o13

    Windows Firewall UDF

    I dug this UDF out in response to a request in the General Help forum. There is still some tidying to do, but I thought I would post here for anyone that would benefit. All functions have been tested on both XP and Windows 7. Updated January 22, 2014: Tested on XP, WIN7 and WIN8.1, x86 and x64 Current version includes: Enable or Disable the Windows Firewall Add or Remove Authorized Applications to the Exclusions list Add or Delete Ports from the Exclusions list. Enable or Disable the use of Exceptions Enable or Disable Notifications of blocked applications Enable or Disable Existing Ports List all Applications in the Exclusions List List all Ports in the Exclusions List List Properties of the current Firewall Configuration Restore the Windows Firewall to its default configuration Windows Firewall.au3
    1 point
  2. It's imposible to create unique rule that would produce the correct (expected) result for this function. For that reason function like this shouldn't exist at all as official UDF, at least not without disclaimer. AutoIt doesn't force the use of any particular language for the users. The rules of AutoIt language syntax nor the rules of English language can't be applied to strings this function accepts. Even if you say _StringTitleCase accepts and processes only English words it would be impossible to create correct output without consulting both dictionary and specific grammar rules. Plus, both syntax and semantics dictates output. Best examples of that are the apostrophes, acronyms or ten other things that could be listed without thinking much. If you pass French sentence or Spanish or Portuguese, not to mention possibility of hundreds of other languages, you get mess. So either keep the algorithm very simple (Title-case) and add disclaimer to the help file or remove the damn function. I think it's clear what I would do.
    1 point
  3. guinness

    Avoid screensaver

    I will play this game too... Do MouseMove(Random(1, @DesktopWidth, 1), Random(1, @DesktopHeight, 1), 1) Until Sleep(30000) = 0
    1 point
  4. Add the following function to EditList.au3 Func _Edit_List_GetSelItem() Return _GUICtrlRichEdit_GetSelText($h_ControlHwnd) EndFunc Ask for any other modification( but try before that ) Regards Phoenix XL
    1 point
  5. All spaces? These examples remove all spaces from a test string. Only the interpretation of all spaces changes. Local $sStr = "a +1 = 1 " & @LF & @TAB & " a new line" ConsoleWrite(StringRegExpReplace($sStr, "\x20+", "") & @LF) ; Remove all spaces, " ". ConsoleWrite("============" & @LF) ConsoleWrite(StringRegExpReplace($sStr, "\h+", "") & @LF) ; Remove all horizontal white spaces, " " and tabs. ConsoleWrite("============" & @LF) ConsoleWrite(StringRegExpReplace($sStr, "\s+", "") & @LF) ; Remove all horizontal and vertical white spaces, " ", tabs, and newlines. ConsoleWrite("============" & @LF) ConsoleWrite(StringStripWS($sStr, 8) & @LF) ; Remove all horizontal and vertical white spaces, as above. ConsoleWrite("============" & @LF) #cs Returns:- a+1=1 anewline ============ a+1=1 anewline ============ a+1=1anewline ============ a+1=1anewline ============ #ce
    1 point
  6. To set row height/column width use something like this: $oExcel.ActiveSheet.Range("2:10").Height = $oExcel.CentimetersToPoints(1.5) ; Height (1.5 cm) for rows 2 to 10 $oExcel.ActiveSheet.Range("A:D").Width = $oExcel.InchesToPoints(2) ; Width in (2 inches) for columns A:D
    1 point
  7. Updated first post with new wrappers/fixes etc. For this example to work you have to make a file UIA.CFG where you can store some of the data For identifying controls I try to put in the dutch and english values for propery names. Sometimes its a best guess for english (I test against a dutch windows) Example 11 Word 2010, Calculator, Notepad #include "UIAWrappers.au3" #AutoIt3Wrapper_UseX64=N ;~ Start the system under test applications _UIA_StartSUT("SUT1") ;~Calculator _UIA_StartSUT("SUT2") ;~Notepad _UIA_StartSUT("SUT3") ;~MS Word ;~ To be moved to UID (User interface definition) files ;~ Set the system under test UID objects to recognize local $UID_WORD[4][2] = [ _ ["mainwindow","classname:=OpusApp"], _ ["btnZoeken","name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl\+F"] , _ ["document","classname:=_WwG"], _ ["btnBold","name:=((Vet)|(Bold))"] _ ] _UIA_setVarsFromArray($UID_Word,"Word.") local $UID_CALC[7][2] = [ _ ["mainwindow","classname:=CalcFrame"], _ ["1","name:=1; controltype:=button"], _ ["2","name:=2; controltype:=button"] , _ ["3","name:=3; controltype:=button"] , _ ["BACKSPACE","AutomationId:=83"] , _ ["mnuEdit","name:=((Edit)|(Bewerken)); controltype:=MenuItem"], _ ["mnuCopy","name:=((Copy.*)|(Kopi.*)); controltype:=MenuItem"] _ ] _UIA_setVarsFromArray($UID_CALC,"Calculator.") local $UID_NOTEPAD[4][2] = [ _ ["mainwindow","classname:=Notepad"], _ ["title","controltype:=50037"], _ ["mnuEdit","name:=((Edit)|(Bewerken))"], _ ["mnuPaste","name:=((Paste.*)|(Plak.*))"] _ ] _UIA_setVarsFromArray($UID_NOTEPAD,"Notepad.") ;~ To be moved to 1 or multiple scriptfiles ;- Set the script ;~ The actual script, 50,10 is only there if a lot of lines and parameters are needed local $script[50][10]= [ _ ["Word.Mainwindow","setfocus"], _ ["Word.btnBold", "click"], _ ["word.document", "sendkeys", "hello world"], _ ["word.btnZoeken", "click"], _ ["calculator.mainwindow", "setfocus"], _ ["calculator.1","click"], _ ["calculator.2","click"], _ ["calculator.3","click"], _ ["calculator.backspace","click"], _ ["calculator.mnuEdit","click"], _ ["calculator.mnuCopy","click"], _ ["notepad.mainwindow", "setfocus"], _ ["notepad.mnuEdit","click"], _ ["notepad.mnuPaste","click"], _ ["notepad.mainwindow","setvalue", "hello world"] _ ] _UIA_launchScript($script) Exit save this to UIA.CFG file ; This is an inifile for UIA wrappers having the configuration defaults ; Debug=true Turn debugging on of off with true/false value ; Highlight=true Turn Highlighting rectangle to true / false ; TODO: AutoStartSUT=true AutoStartSUT is starting all SUT's automatically [Global] Debug=true Highlight=true AutoStartSUT=true [Multiuser] CFGPerUser=false [Folders] subfolders=false ;System under test settings ; Folder = Location where exe can be found ; Workingdir = Location of the working directory ; exe = Name of the exe to start ; Fullname = Path & name of exe ; Windowstate = minimized, maximized, normal [SUT1] Folder=%Windowsdir%\system32 Workingdir=%Windowsdir%\system32 exe=calc.exe Fullname=%Windowsdir%\system32\calc.exe Parameters= Processname=calc.exe Windowstate=normal [SUT2] Folder=%Windowsdir%\system32 Workingdir=%Windowsdir%\system32 exe=notepad.exe Fullname=%Windowsdir%\system32\notepad.exe Parameters= Processname=notepad.exe Windowstate=normal [SUT3] C:\Program Files (x86) Folder=%programfilesdir%\Microsoft Office\Office14 Workingdir=%programfilesdir%\Microsoft Office\Office14 exe=winword.exe Fullname=%programfilesdir%\Microsoft Office\Office14\winword.exe Parameters= Processname=winword.exe Windowstate=normal
    1 point
×
×
  • Create New...