Jump to content

Recommended Posts

  • Administrators
Posted

I've added these experimental PowerShell Cmdlets to the beta download. 

To use open PowerShell ISE:

Import-Module "C:\Program Files\AutoIt\Beta\AutoItX\AutoItX3_PS.dll"

Wait-AU3WinActive -Title "Untitled - Notepad"

You will need to specify "C:Program Files (x86)" if you have a 64bit system.

It should work with PowerShell v2.0 or v3.0 - although it's in a very early stage yet.

Current CmdLets Implemented

Get-AU3ErrorCode
Initialize-AU3
Set-AU3Option
Send-AU3Key
Show-AU3WinActivate
Close-AU3Win
Get-AU3WinText
Get-AU3WinTitle
Close-AU3Win
Wait-AU3Win
Wait-AU3WinActive
Wait-AU3WinClose
Wait-AU3WinNotActive


 

  • Administrators
Posted

I'm going to use Parameter Sets to allow a lot of the Win functions to either accept Title/Text paramters or a proper window handle (HWND) that can be obtained from Get-WinHandle (next beta).

PS> Get-Help Wait-AU3WinClose

NAME
    Wait-AU3WinClose
    
SYNTAX
    Wait-AU3WinClose [-Title] <string> [[-Text] <string>] [[-Timeout] <int>]  [<CommonParameters>]
    
    Wait-AU3WinClose [-Handle] <IntPtr> [[-Timeout] <int>]  [<CommonParameters>]

The window handle will be treated as the .NET IntPtr type:

$handle = Get-AU3WinHandle -Title "Untitled - Notepad"

$handle.GetType()

IsPublic IsSerial Name                                     BaseType                                                     
-------- -------- ----                                     --------                                                     
True     True     IntPtr                                   System.ValueType

This will be far easier than trying to shoe-horn handles into strings.


 

  • Administrators
Posted

AutoIt didn't work with real handles when I first made AutoItX - handles were strings in there too.  AutoItX is mostly is simple wrapper around the AutoIt functions so is a symptom of the time it was developed and then never updated.


 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...