I want my SDI app to return the entered-text to the caller app (which called it using ShellExecute() function). The only way that seems feasible to me is via clipboard.

Now SDI app writes the entered text to the clipboard when its "Close" button is pressed. I intend to show these contents on the caller app and have written the code for that.

But the problem is that in the caller app, the text of clipboard is shown as soon as the SDI window is shown, i.e. it doesn't wait for the SDI app to close and then show the content. Rather whatever is currently on the clipboard, is shown then and there.

Is there any way to keep this code from execution until the called app terminates?

Recommended Answers

All 2 Replies

If you replace ShellExecute() with CreateProcess() the caller process will get a handle and can then call WaitSigngleObject() to wait until the spawned process terminates.

Oh thnx. Let me try this now. Sigh!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.