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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Close Acrobat Reader 2

Status
Not open for further replies.

SGLong

Programmer
Jun 6, 2000
405
US
Using tips from this forum I am using VFP to background print PDF files. Also using tip from here I am closing the Acrobat Reader. The closing of Acrobat is only partially successful. The program disappears from the task bar, but if I open up the task manager I still see AcroRd32.exe in the list. In fact, if I print three documents there are three instances of AcroRd32.exe in the task list. How can I fully close Acrobat?

Steve
 
Steve,

I can't answer your question, but I can say that I've spent long hours trying to find a solution and eventually gave up.

I now don't even try to close the reader in the task bar. If you leave it open, it will re-use the same instance each time (at least, I've always assumed that was the case). Also, it will be obvious to the users that it's open, which might be better than having multiple instances open in the background and no obvious way for the user to close it interactively.

I hope someone can answer your question.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Steve,


DDEChan = DDEInitiate("Acroview", "Control")
=DDEExecute(DDEChan, '[CloseAllDocs()]')
=DDEEXECUTE(ddechan,'[AppExit]')


n
 
I'll pass on a piece of code that I use which I got a while back from somewhere on the web (possibly one of this forum's FAQ's). I apologize to the author for not giving them recognition.

I use this to close un-wanted running copies of executables.

Code:
lcProcess = "OUTLOOK.EXE"  && Process to be closed

lcComputer = "."
loWMIService = GETOBJECT("winmgmts:" ;
               + "{impersonationLevel=impersonate}!\\" + lcComputer + "\root\cimv2")
colProcessList = loWMIService.ExecQuery ("Select * from Win32_Process")
IF TYPE('colProcessList') = "O"
   FOR EACH loProcess IN colProcessList
      IF ALLTRIM(UPPER(loProcess.NAME)) == ALLTRIM(UPPER(lcProcess))
         loProcess.TERMINATE()
       ENDIF
   NEXT
ENDIF  && IF TYPE('colProcessList') = "O"
RELEASE colProcessList, loWMIService

Good Luck,
JRB-Bldr
 
A star to Nigel... that DDE tip was perfect. Thanks.

 
Steve

thanks for the star...

btw... the syntax for printing files etc is

lcfile=fullpath(getfile("PDF"))
=Ddeexecute(DDEChan, '[FilePrintSilent("&lcfile")]')


nigel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top