Question Locked

Calling an application and terminate

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Iam new in using API

I want to execute and application then terminate using the postmessage of which of now i don't know. What i want is the application to start automatically and exit on when i run the code.

I want to use Visual Basic

Please help

2 replies

by tony hopkinson

http://support.microsoft.com/kb/129796

WM_Close is the message you usually post to an app. You needs the process's window handle to do it, and it might ignore you.

PostMessage is asynchronous, SendMessage will wait for the message to be responded to remember, that might be never...

If you want to tidy up after the called application has closed. PostMessage + poll to see if the propcess handle still exists will be better.

If you've written the app you are calling you can get a lot better control.

This discussion is closed to new replies.