Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why doesn't the app close?

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
Once again, this problem refers to the 3rd party software we are using with our paradox application. I use the following code to try and close the application from Paradox, but for some unknown reason it doesn't work:

t = ":reportsDB:Windows.db"

sleep(13000)
enumWindowHandles(x,"#32770")

forEach str in x
li = longInt( str )
winSendMessage( li, WM_CLOSE, 0, 0 )
endForEach

Any ideas why it's not working?
 
You appear to be trying to have an effect on a CLASS of application.

It is possible that you are trying to close one aspect of the application that can't be closed, and so Paradox is erroring out on that aspect and not getting to the actual application.

You might add a 'try' block and see if there are any errors.

forEach str in x
li = longInt( str )

try
winSendMessage( li, WM_CLOSE, 0, 0 )
onFail
errorshow()
endTry
endForEach

You might also save the dynarray values, then create a script and insert each value one at a time and see if you can succeed.

It may also be that the windows/aspects must be closed in a certain order. You may have to play with order-of-closing in order to succeed.

Most of this is supposition. But I found that some applications have entries that can't be closed; they close when the main application closes. Outlook is one such, I believe.

Tony McGuire
 
Ok, so what are my other alternatives for closing the app?
 
You haven't even said which app it is. It may not make any difference, unless someone has tried closing that app before, but it could make all the difference.

However, have you tried closing things in different orders to see if that works?

Last resort, use sendkeys() after bringing that app to top.


Tony McGuire
 
..what are my alternatives.."

Did you try the 'try..' methodology?

Did you get any errors displaying to help you?

If no errors, you might try setting errortraponwarnings(true) prior to the 'for' block.

Tony McGuire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top