Get Child that is a dialog box

Apr 29, 2014 at 1:00 AM
I have a window that when opened starts a dialog box for user feedback.

How do I pipe to the dialog box to do edits since it is not classifed as a window (in which case I would use UIAChildWindow).

Is there a function to pipe to a dialog box?
May 10, 2014 at 1:34 PM
Hi,
there have been added new parameters to the get-uiawindow cmdlet. A dialog is usually a window, and the spy needs updating to support these new parameters.

Most likely, your problem could be resolved as:
Get-UiaWindow -pn process_name_of_your_app -Name "*your*dialog*name*"
or
Get-UiaWindow -pn process_name_of_your_app -Name "*your*dialog*name*" -WithControl @{controlType="button";name="OK"}
You could use -Name, -AutomationId and/or -Class as parameters for a cmdlet and any properties of control(s) on the dialog.
The only restriciton is not to use the Get-UiaWindow without procecc name (-ProcessName, -pn), or process id (-ProcessId, -pid), or process (-InputObject, -p_ parameters - this would lead tovery deep search (new parameters activate the -Recurse parameter automatically).
May 12, 2014 at 3:28 PM
I'm excited to try this as I think it might work, but my process isn't as simple as a calculator for example.

Would the process name show up under in Inspector for a given window or would I have to know the process name?
May 12, 2014 at 8:46 PM
Does your dialog grow from another process?
I dealt with such windows: they are usually seen as a window from another process (a custom action in a setup, for example. The setup program grows from msiexec, but the custom action window grows from another process).
The best way is to get it via Get-UiaWindow -pn ... -n ...

If your dialog is a window in your process, you could simply get it using Get-UiaWindow -pn ... -n/-au/-class (a combination of process name and necessary parameters: Name, AutomationId, Class)

if your dialog is a pane, menu or another container floating around, there are two options: the previous (the Get-UiaWindow cmdlet counts top-level menus (a context menu on the desktop for example) and panes (Taskbar, for examples) as windows.
Another option is to use Get-UiaWindow | Get-UIaYourDialogType

The worst case I ever met was a snap-in to mmc.exe 32-bit on 64-bit window, throwing a form before the main mmc window appears. The process id of the first window was not the same as process id of the main window, and the first window was very hard to get. I solved it via a series of Get-UiaWindow with various parameters...