Using AI is largely a waste of time to solve programming issues, or research "how to" questions. Microsoft provides a comprehensive set of documentation that you should make use of.
Using ShellExecute runs the search in a separate Window. So there is no way you can click any of the items listed and get them into your dialog automatically. If you want to read the data into your application then you will need to use the API to access the records. See
Dsquery.h header - Win32 apps | Microsoft Learn[
^].