I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal
You can try the BringWindowToTop function to not steal focus. I haven't used it, but it seems to be what you're looking for.