Q : Not the classic how to close an external App ? 
Author Message
 Q : Not the classic how to close an external App ?

Hi all,

I've read a lot of articles about closing an external App by using
TerminateProcess, CloseHandle or SendMessage, etc..

BUT, my pb is that, I would like to programmatically close an external
application without any user interaction. For example, close Winword without
any prompt even if there is an unsaved modified document opened.

In this case (a modified document), when I'm trying to close, in all ways,
there is always a prompt message.

If I use several time the close API on the same application when a prompt
for document's save dialog box is open, the application craches in a GPF in
USER32.EXE...

Does anyone has the solution ?

Big thanxs to you all.

Steph.



Sun, 13 Jan 2002 03:00:00 GMT  
 Q : Not the classic how to close an external App ?
Whoever has the answer, can you also please tell me how to protect my
app from other people's apps that want to shut me down while ignoring my
QueryUnload functionality?


Sun, 13 Jan 2002 03:00:00 GMT  
 Q : Not the classic how to close an external App ?


Fri, 19 Jun 1992 00:00:00 GMT  
 Q : Not the classic how to close an external App ?
You could try locking the desktop window with LockWindowUpdate API so that
you don't see the dialog appear then postmessage to cancel the saving ie
click the cancel button on the save dialog then test to see if the
application closed before unloacking the desktop window. Under all
circumstances you will need to make sure that the desktop window is unlocked
after execution otherwise you will not be able to see anything that happens
while you are clicking on the desktop.
Chris

Quote:

>Hi all,

>I've read a lot of articles about closing an external App by using
>TerminateProcess, CloseHandle or SendMessage, etc..

>BUT, my pb is that, I would like to programmatically close an external
>application without any user interaction. For example, close Winword
without
>any prompt even if there is an unsaved modified document opened.

>In this case (a modified document), when I'm trying to close, in all ways,
>there is always a prompt message.

>If I use several time the close API on the same application when a prompt
>for document's save dialog box is open, the application craches in a GPF in
>USER32.EXE...

>Does anyone has the solution ?

>Big thanxs to you all.

>Steph.



Sun, 13 Jan 2002 03:00:00 GMT  
 Q : Not the classic how to close an external App ?


Fri, 19 Jun 1992 00:00:00 GMT  
 Q : Not the classic how to close an external App ?
:-)

~~~~~~~~~~~~~~~~~~
   Klaus H. Probst
~~~~~~~~~~~~~~~~~~


Quote:
> Whoever has the answer, can you also please tell me how to protect my
> app from other people's apps that want to shut me down while ignoring my
> QueryUnload functionality?



Sun, 13 Jan 2002 03:00:00 GMT  
 Q : Not the classic how to close an external App ?


Fri, 19 Jun 1992 00:00:00 GMT  
 Q : Not the classic how to close an external App ?
*EVEN* Microsoft is nice enough to ask before they close a running program
down -- *even* when closing down Windows itself.

Rick

Quote:

>Hi all,

>I've read a lot of articles about closing an external App by using
>TerminateProcess, CloseHandle or SendMessage, etc..

>BUT, my pb is that, I would like to programmatically close an external
>application without any user interaction. For example, close Winword
without
>any prompt even if there is an unsaved modified document opened.

>In this case (a modified document), when I'm trying to close, in all ways,
>there is always a prompt message.

>If I use several time the close API on the same application when a prompt
>for document's save dialog box is open, the application craches in a GPF in
>USER32.EXE...

>Does anyone has the solution ?

>Big thanxs to you all.

>Steph.



Fri, 18 Jan 2002 03:00:00 GMT  
 Q : Not the classic how to close an external App ?

Quote:

> *EVEN* Microsoft is nice enough to ask before they close a running program
> down -- *even* when closing down Windows itself.

> Rick


> >Hi all,

> >I've read a lot of articles about closing an external App by using
> >TerminateProcess, CloseHandle or SendMessage, etc..

> >BUT, my pb is that, I would like to programmatically close an external
> >application without any user interaction. For example, close Winword
> without
> >any prompt even if there is an unsaved modified document opened.

> >In this case (a modified document), when I'm trying to close, in all ways,
> >there is always a prompt message.

> >If I use several time the close API on the same application when a prompt
> >for document's save dialog box is open, the application craches in a GPF in
> >USER32.EXE...

> >Does anyone has the solution ?

> >Big thanxs to you all.

> >Steph.

It depends on the program you want to close.  If you want to close Word or
Access for example, you normally work with Access or Word through there
automation interface.  You can assign a word object or access object to a
regular object.  I like to include a reference to Word or Access.  Example:

    dim oAccess as Object  '//or Access.Application, you can use either

    set oAccess = getObject("Access.Application")  '// works if access is open
    '#######################################################################
    '# set oAccess = getObject("", "Access.Application")  '//works if access is
NOT open, it opens it
    '#######################################################################

    oAccess.DoCmd.Quit acNoSave  '//i am not sure what the value to pass it
was, look it up in help
    set oAccess = Nothing

In Microsoft Word or Access there is a good help doc.  Under help look up Word
VBA or Access VBA, and do a lot of reading,  and practice.

Good Luck,

James Drabb, Jr.
AIG Marketing, Inc.     MIS/Systems Programmer




Mon, 21 Jan 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Q : Not the classic how to close an external App ?

2. Q : Not the classic how to close an external App ?

3. How to wait for an external program to close before running my VB app

4. OpenWith External App Get ID To CLose

5. using vb6 to close an external app

6. VB closing app vs. Windows closing app

7. VB apps that run in bkgrnd, DoEvents Qs

8. Could'nt find installable ISAM - classic error but not easy

9. ..........Re: App Not Closing

10. App Not Closing

11. app not closing completely

12. Data control`does not close file until app exits

 

 
Powered by phpBB® Forum Software