I have this ancient program which uses Wordpad and the append general
process
This has worked fine for 20 years but lately is playing up where, during
the printing process, you can see it places Word.exe in the task bar

This causes a problem where the template INV.DOC is held open by Word
I thought the solution would be simple by killing word but this works
sometimes, but not always.
I do this

PARAMETERS whatprg
*lcProcess = "IEXPLORE.EXE"  && Process to be closed
lcProcess=whatprg+".EXE"
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

Is there a better way ?

-- 
Kind regards
Sytze de Boer
Kiss Software


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CAG1nNy-hrP=mngocw4rjcq6atmtgvwopfomyyt-ikktqazb...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to