Appium+WinAppDriver - Attach to Existing Application

Has anyone used Appium+WinAppDriver in React-Native JavaScript to attach to an existing application? This is a necessity for our project, but I’ve hit a roadblock.

WinAppDriver gives us the ability to attach to an already-running app. However, it requires a window handle, which changes on every instance of an app running (non-constant). I’m not sure how I could find the window handle I need in React-Native… I don’t believe we can query the OS for running process’ in RN (assuming security issue?)

Has anyone else encountered this? Anyone have any ideas for a solution?

Here’s a solution in C#:

Looks like it could be easily adapted to whatever language you didn’t say you were using.