How can I Use Attach Window activity to attach to a window using its Window Handle?
More specifically, how to I convert an workflow argument to UiPath.Core.Window type so it can be accepted in the Attach Window’s Input->Window property?
I am passing the window handle’s value, when I invoke the workflow: (e.g. in_Handle (Int32) = 00001234). This value needs to be converted to a UiPath.Core.Window.
Subsequent workflow processing will use Trigger Scope and Element Attribute Change Trigger to monitor a Java selector’s “text” attribute for change, and on change, perform additional workflow activities.
In the future, for anyone interested in using a Window Handle to Attach to a Window:
Use Case: Monitor a window for a change made interactively by the end user. Then invoke a different workflow or perform some additional workflow activities.
Note: in_Handle is a workflow input argument. in_Handle’s value (in my case e.g. 0x00010D46 or 68934), will change each time the window is created, so you need to use a different application or workflow to get the Window Handle’s value and pass this to the workflow: in_Handle.
Here are the Attach Window properties
Notice that only the Window property is needed:
After the Attach Window activity successfully executes, other activities based in Selectors in the Attached Window, can occur. In my case, I monitor for updates: Here is my sample sandbox workflow: