I have an application that will shut down all instances of another specific
application ( ie. like Word). But it has problems if the application has a
modal dialog window open.

I have tried getting the handle to the dialog box and setting it to the
active window and then using sendkeys() to close the dialog window. I am
not to happy with this method.

Is there an API call that I can make to close the the window or even send it
a message like ID_CANCEL or ID_OK ???