Leaderboard
Popular Content
Showing content with the highest reputation on 12/09/2021 in all areas
-
As soon as I have published my version of MrCreator's tool including documentation everyone will be able to create a CHM help file for his UDfs3 points
-
Thanks to @water on the Wiki we have new page: https://www.autoitscript.com/wiki/WebDriver_Capabilities1 point
-
By default, no UIA code in C# or VB.NET applicationsNote that an example GUI created as described in first post will generally not contain UIA code to automate the controls. Only standard Windows controls that can already be automated with classic code will also be able to automate with UIA code. Other controls including all the interesting .NET controls, e.g. the DataGridView control, which is not derived from the standard controls, can only be automated with MSAA code. By default, a program created with C# or VB.NET code will not contain UIA code except for the standard Windows controls. Otherwise only MSAA code. At top of this post is an example with the DataGridView control, which clearly demonstrates this. tst00.vb and tst00.au3 can be found in GridControls.7z at bottom of said post. Running tst00.au3 creates a GUI like this: UIASpy shows the element tree structure for all controls throughout the GUI as follows: 0000 Window: WindowsForms10.Window.8.app.0.3e799b_r35_ad1 0001 Pane: WindowsForms10.Window.8.app.0.3e799b_r35_ad1 0002 Button: Add Row 0003 Button: Delete Row 0004 Table: DataGridView 0005 Custom: Top Row 0006 Header: Title 0007 Header: Artist 0008 Header: Album 0009 Header: Release Date 0010 Header: Track 0011 Custom: Row 0 0012 Custom: Title Row 0 0013 Custom: Artist Row 0 0014 Custom: Album Row 0 0015 Custom: Release Date Row 0 0016 Custom: Track Row 0 0017 Custom: Row 1 0018 Custom: Title Row 1 0019 Custom: Artist Row 1 0020 Custom: Album Row 1 0021 Custom: Release Date Row 1 0022 Custom: Track Row 1 0023 Custom: Row 2 0024 Custom: Title Row 2 0025 Custom: Artist Row 2 0026 Custom: Album Row 2 0027 Custom: Release Date Row 2 0028 Custom: Track Row 2 0029 Custom: Row 3 0030 Custom: Title Row 3 0031 Custom: Artist Row 3 0032 Custom: Album Row 3 0033 Custom: Release Date Row 3 0034 Custom: Track Row 3 0035 Custom: Row 4 0036 Custom: Title Row 4 0037 Custom: Artist Row 4 0038 Custom: Album Row 4 0039 Custom: Release Date Row 4 0040 Custom: Track Row 4 0041 Custom: Row 5 0042 Custom: Title Row 5 0043 Custom: Artist Row 5 0044 Custom: Album Row 5 0045 Custom: Release Date Row 5 0046 Custom: Track Row 5 0047 Custom: Row 6 0048 Custom: Title Row 6 0049 Custom: Artist Row 6 0050 Custom: Album Row 6 0051 Custom: Release Date Row 6 0052 Custom: Track Row 6 0053 Custom: Row 7 0054 Custom: Title Row 7 0055 Custom: Artist Row 7 0056 Custom: Album Row 7 0057 Custom: Release Date Row 7 0058 Custom: Track Row 7 0059 TitleBar 0060 MenuBar: System 0061 MenuItem: System 0062 Button: Minimize 0063 Button: Maximize 0064 Button: Close Recognized controls can be automated with UIA code. Custom controls can only be automated with MSAA code. The $UIA_ProviderDescriptionPropertyId, which is a text string, provides some information about how a window or control can be automated: [pid:4496,hwnd:0x602D2 Main:Nested [pid:2976,hwnd:0x602D2 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)] If the string contains Proxy substrings such as Microsoft: MSAA Proxy or Microsoft: HWND Proxy, it can be automated with MSAA code or classic code. There are many different of these Proxy substrings. To add more UIA code to the program take a look at the UI Automation Provider Programmer's Guide. It's not necessarily completely trivial. I don't know if it's possible through Visual Studio to more easily add at least default UIA code to actual .NET controls implemented in C# or VB.NET. Maybe junkew or Earthshine know something about this. At first glance, I think it's easier to test with existing programs that already contain more complete UIA code e.g. File Explorer and Calculator. Whether testing with File Explorer and Calculator or with .NET programs is completely indifferent to the UIA code. The UIA code to click a button, a menu item, set a selection in a table, or expand/collapse a treeview control element as well as other automation actions is exactly the same for all programs, as long as the controls support the required UIA code. In UIA code, automation actions as mentioned above are implemented through pattern interfaces. There are already a number of examples of the use of these automation actions and similar pattern interfaces in this post. Then it might be the easiest place to start. If you want, you can test some of the examples in other programs.1 point
-
MS SQL Server connection with AutoIT
Earthshine reacted to v4nandu for a topic
$DSN = 'DRIVER={SQL Server};SERVER=' & $sServer & ';DATABASE=' & $sDatabase & ';UID=' & $sUID &';PWD=' & $sPWD & ';' $oConn = ObjCreate ("ADODB.Connection") $oConn.ConnectionTimeout = 3 ; default is 15 s (must be supported by data provider DSN) $oConn.Open($DSN) Thanks Jos for the quick reply... I got the issue solved using this MS SQL connection - AutoIt General Help and Support - AutoIt Forums (autoitscript.com) Earthshine - that was nice... Thanks team1 point -
This will be my next project. No additional tools are needed - it's pure AutoIt Edit: Wrong - It's not pure AutoIt. hhc.exe, hha.dll, itcc.dll from "HTML Help Workshop" are needed. The installation ZIP comes with all needed files.1 point
-
What do you mean with "Testing GUI Window"? Are you referring to au3inf? The main idea is to easily provide possible modifications to the "Testing GUI Window", and no need for any other tool than the AutoIt + SciTE kit. But how do you see this new tool then? Not sure what you miss in the current tool set exactly? simplespy and uiaspy deliver code snippets for all elements that are uia compatible "I would like to create example windows with standard elements like ComboBox, ListView, some Button, some text, some edit field." So this means: In each example window one specific element? What would you do then with such kind of example window.1 point
-
I am not sure what you are exactly trying to find out for the different drives are you saying: If I have drives a,b,c,d then i want to have [e-z] returned as beeing free drive letters to use? and as such e and z you want to have returned I probably would start with https://www.autoitscript.com/autoit3/docs/functions/DriveGetDrive.htm #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> local $allDriveLetters="CDEFGHIJKLMNOPQRSTUVWXXYZ" Local $aArray = DriveGetDrive($DT_ALL) If @error Then ; An error occurred when retrieving the drives. MsgBox($MB_SYSTEMMODAL, "", "It appears an error occurred.") Else For $i = 1 To $aArray[0] ; Show all the drives found and convert the drive letter to uppercase. ;MsgBox($MB_SYSTEMMODAL, "", "Drive " & $i & "/" & $aArray[0] & ":" & @CRLF & StringUpper($aArray[$i])) $driveLetter=stringleft(StringUpper($aArray[$i]),1) $allDriveLetters=stringreplace($allDriveLetters,$driveLetter,"") Next EndIf consolewrite("Drive letters available :" & @CRLF & $allDriveLetters & @CRLF) consolewrite("First: " & stringleft($allDriveLetters,1) & @CRLF) consolewrite("Last: " & stringright($allDriveLetters,1) & @CRLF) and with wmi you can query info $oWMISvc = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") $colDiskDrives = $oWMISvc.ExecQuery("SELECT * FROM Win32_DiskDrive") For $oDiskDrive In $colDiskDrives ConsoleWrite("DiskDrive = " & $oDiskDrive.DeviceId & " Caption = " & $oDiskDrive.Caption & @LF) $sQuery = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" & $oDiskDrive.DeviceId & "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition" $colPartitions = $oWMISvc.ExecQuery($sQuery) For $oPartition In $colPartitions ConsoleWrite(@TAB & "Partition = " & $oPartition.DeviceId & @LF) $sQuery = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" & $oPartition.DeviceId & "'} WHERE AssocClass = Win32_LogicalDiskToPartition" $colLogicalDisks = $oWMISvc.ExecQuery($sQuery) For $oLogicalDisk In $colLogicalDisks ConsoleWrite(@TAB & @TAB & "LogicalDisk = " & $oLogicalDisk.DeviceId & @LF) Next Next Next1 point
-
[Question] Why `send('#L') ` does not work?
HoratioCaine reacted to Jos for a topic
Logoff is something different than Workstation Lock. !1 point