Start external app with ShellExecuteEx and wait until it become initialized

前端 未结 3 427
轻奢々
轻奢々 2020-12-31 18:10

I have an application which needs to run several other applications in chain. I am running them via ShellExecuteEx. The order of running each of the apps is ver

相关标签:
3条回答
  • 2020-12-31 18:18

    If your application has some custom initialization logic that doesn't run in UI thread then WaitForInputIdle might not help. In that case you need a mechanism to signal the previous app that you're done initializing.

    For signaling you can use named pipes, sockets, some RPC mechanism or a simple file based lock.

    0 讨论(0)
  • 2020-12-31 18:22

    You can always use IPC and Interpocess Synchronization to make your application communicate with (and wait for, if needed) each other, as long as you code both applications.

    0 讨论(0)
  • 2020-12-31 18:31

    You can probably achieve what you need by calling WaitForInputIdle() on each process handle returned by ShellExecute().

    Waits until the specified process has finished processing its initial input and is waiting for user input with no input pending, or until the time-out interval has elapsed.

    0 讨论(0)
提交回复
热议问题