Starting and closing an external application

hog

Registered User.
Local time
Today, 08:03
Joined
Jan 24, 2005
Messages
14
I know you can start an external application using the Shell command but is there a way to close this external application once you have finished with it?
 
In general, you close the app from within the app itself.

The whole point of using Shell is to spawn an independent process that can go on about its business without bothering you again. The BEST way to close the app process and window is therefore to have the app itself decide to go away.

If you have to actually kill the spawned window, I would say the app is, among other things, not very well-behaved. In any case, you would need to look at some Win32 API calls to identify the window in which that app is running (so you can get the Window Handle). Once you have the Window Handle, you can control - i.e. close - the window.

I am not near my Win32 reference books so I cannot give you more direct advice than that. But a good search of on-line Windows docs using Win32 API plus Window Handles as keywords for searching should turn up a web-load of stuff the read.
 
Thanks for the code I will plumb this in and see how it works.

The app in question is the ClickYes app to get rid of the security popups when accessing Outlook from Access. I want to open ClickYes when and email needs to be sent and then close it when finished with.

Thnx
 
You should check out Outlook Redemption to get around the Outlook 2003 security warnings.

I have never used it but I have read good things about it.
 

Users who are viewing this thread

Back
Top Bottom