Reputation: 873
I have below sample code for my wpf app. I need to fill in text fields of form with strings.
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)
it returns 0 for $returnVal2 and Empty string for $returnValue1. However this works fine for my sample winform application.
Any clues why this behaviour is..and Any tweaks available to get exact text-box to auto fill data for wpfa app.
Upvotes: 4
Views: 4015
Reputation: 50682
WPF applications do not use Windows' controls and handles for the controls. You can see that by using Spy++. WPF Alternatives for Spy++
If you want to automate WPF applications you will need another tool or use the UI Automation API to build one.
Upvotes: 9