Hi Aleksey, I also need to get window by Handler.
I’ve tried to edit window-selector attributes manually (for attach window activity) to include hwnd (actually, UI Explorer is able to recognize hwnd of windows, see UI Explorer->Property Explorer). Specifying hwnd as decimal or hex does not work. May be you can be lucky enough to solve it.
One option, which works, but is far not elegant: iterate through windows of your application:
- use dynamic selector like “wnd app=‘chrome.exe’ idx=‘0’” (add opening and closing symbols. If I add them myself, forum thinks it’s an html tag
) by variating idx value
- for each acquired by “attach window” UiPath.Core.Window variable, you may compare its Handle with the desired one
- error handling, when window with such idx does not exist => stop looping
- further steps are trivial
I guess, something like that should be possible within Invoke Code, however, I don’t know, how to access all available windows there.
If you find a better solution, let me know – it would be very helpful.