AutoIt with wpf

Ane*_*ees 3 wpf autoit

我有以下wpf应用程序的示例代码.我需要用字符串填写表单的文本字段.

    Run('AutoItWpfTesting.exe')
    WinWaitActive("Window1", "")

    $hHwnd = WinGetHandle("Window1")
    MsgBox(0, "Message", $hHwnd)

   $returnVal1=ControlGetHandle ( "$hHwnd", "", "[NAME:txtVersion]")

   $returnVal2=ControlSend($hHwnd,"","[NAME:txtVersion]","blahblah")

   MsgBox(0, "Message", $returnVal2)
Run Code Online (Sandbox Code Playgroud)

$ returnVal2返回0,$ returnValue1返回空字符串.但是这适用于我的示例winform应用程序.

任何线索为什么这种行为是..和任何调整可用于获取精确的文本框自动填充wpfa应用程序的数据.

Ern*_*rno 8

WPF应用程序不使用Windows的控件和控件句柄.你可以通过使用Spy ++来看到它.WPF替代Spy ++

如果要自动化WPF应用程序,则需要使用其他工具或使用UI Automation API构建一个.