viewpoint-particle

Author Topic: Control Manager extender & WPF/XAML  (Read 170 times)

ChuckC

  • Sr. Member
  • ****
  • Posts: 390
Control Manager extender & WPF/XAML
« on: April 12, 2022, 02:44:20 pm »
I was meandering thru the tech support database looking for articles related to WPF & XAML in connection with the Control Manager extender, but didn't find anything helpful.

Are there known limitations when it comes to using the Control Manager extender to enumerate, interrogate & manipulate the various UI elements [e.g. controls] that are present in a WPF form generated from XAML?

The various built-in windows analysis scripts don't seem to be producing any results that would make me think that a script could be developed to control the form in a way that allows for finding a text box, entering some text in it and then clicking a button.

stanl

  • Pundit
  • *****
  • Posts: 1633
Re: Control Manager extender & WPF/XAML
« Reply #1 on: April 13, 2022, 03:23:18 am »
Not related to your question but if you search XAML on this forum there is a thread related to WPF and XAML - more related to CLR.

ChuckC

  • Sr. Member
  • ****
  • Posts: 390
Re: Control Manager extender & WPF/XAML
« Reply #2 on: April 13, 2022, 05:30:52 am »
Noted.  I did read a tech support db article on how to use CLR hosting to display a window via WPF/XAML, but that's helpful with what I'm trying to do.  I have a need to automate the interaction with a XAML-based WPF window/dialog with a couple of controls on it.  In WinBatch & the Control Manager extender can do it, I should be able to get my new employer to buy a couple of licenses for it.

td

  • Tech Support
  • *****
  • Posts: 4062
    • WinBatch
Re: Control Manager extender & WPF/XAML
« Reply #3 on: April 13, 2022, 07:17:37 am »
Unfortunately, I don't think Control Manager will be able to help you. Control Manager is designed to work with the raster graphics base user32 and common control Windows controls and not the vector graphics based WRT and XAML Windows windows. MSFT has seen fit to provide a couple of dotNet Framework assemblies that are covers for the COM based Automation APIs. Here is a link to a Tech Database article that demonstrates the use of the "System.Windows.Automation"  classes to query information from an instance of the Chrome browser. It is not exactly what you are looking for but could serve as a starting point.

https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/dotNet/System_Windows/System_Window_Automation+Use~System.Windows.Automation~to~List~Chrome~Tabs.txt
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

ChuckC

  • Sr. Member
  • ****
  • Posts: 390
Re: Control Manager extender & WPF/XAML
« Reply #4 on: April 13, 2022, 07:36:31 am »
Thanks!  I took a quick look at it and I'll do some more reading and see if I can adapt it to work with the particular WPF/XAML window that I need to automate.

td

  • Tech Support
  • *****
  • Posts: 4062
    • WinBatch
Re: Control Manager extender & WPF/XAML
« Reply #5 on: April 13, 2022, 09:04:11 am »
Here is a link to another example:

https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/dotNet/System_Windows/System_Window_Automation+Grab~Property~Names~of~Controls.txt

The bad news is that the Windows UI elements must provide some support on their end for the interfaces to work but the good news is that most UI elements created with MSFT tools and high-level APIs do have support built in.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

ChuckC

  • Sr. Member
  • ****
  • Posts: 390
Re: Control Manager extender & WPF/XAML
« Reply #6 on: April 13, 2022, 09:32:22 am »
The application in question is a simple C# program that loads the XAML from an external source like a file or a registry value and then uses WPF to present a UI.  I'd expect that meets the requirements, but I'll find out for certain when I carve out some time to go hands-on with it later today or tomorrow.