How can I get the current window handle so that I can use it (If there are multiple windows with same name)

I have a similar problem described below. I cannot rely on the title to select a window but need a unique identifier. How can I get the current window handle so that I can use it switch back later ?

The solution of the above problem says I can use New UiPath.Core.Window(CType(in_Handle, IntPtr)). But how can I get in_Handle value ?

In_handle is a value that I pass as an argument to the UiPath workflow. I use Autohotkey to find the target window title text and get the int32 handle value. I then call the workflow from AHK script. You can also use UiPath Get Attribue to get the handle value.

Thanks for your help. I do not see handle ID in the drop down for get Attribute. I see only PID. Are they same ?

Attribute is Hwnd. You can also see the value with UiExplorer.
The Hwnd value changes each time the application / window instantiates.

Thanks. It works

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.