Porque solo quiero usar el comando:
Code: Select all | Expand
// PARA DESLIGAR O OUTLOOK, SE ESTIVER ABERTO AINDA. Joao
WaitRun( "CMD /C TASKKILL.EXE /IM OutLook.exe /F", 0 )
Gracias, tks.
Regards, saludos.
Code: Select all | Expand
// PARA DESLIGAR O OUTLOOK, SE ESTIVER ABERTO AINDA. Joao
WaitRun( "CMD /C TASKKILL.EXE /IM OutLook.exe /F", 0 )
Code: Select all | Expand
// Método para verificar si Outlook está abierto
FUNCTION IsOutlookRunning()
LOCAL hWnd
// Buscar la ventana de Outlook
hWnd := FindWindow("OlMainFrame", NIL)
RETURN hWnd != 0
Code: Select all | Expand
FUNCTION CheckOutlookProcess()
LOCAL aProcessList, lOutlookRunning := .F.
LOCAL i
// Obtener lista de procesos
aProcessList := GetProcessList()
// Recorrer procesos buscando Outlook
FOR i := 1 TO LEN(aProcessList)
IF UPPER(aProcessList[i]) == "OUTLOOK.EXE"
lOutlookRunning := .T.
EXIT
ENDIF
NEXT
RETURN lOutlookRunning
Code: Select all | Expand
FUNCTION CheckOutlookProcess()
LOCAL aProcessList, lOutlookRunning := .F.
LOCAL i
// Obtener lista de procesos
aProcessList := GetProcessList()
// Recorrer procesos buscando Outlook
FOR i := 1 TO LEN(aProcessList)
IF UPPER(aProcessList[i]) == "OUTLOOK.EXE"
lOutlookRunning := .T.
EXIT
ENDIF
NEXT
RETURN lOutlookRunning
Code: Select all | Expand
// Método para verificar si Outlook está abierto
FUNCTION IsOutlookRunning()
LOCAL hWnd
// Buscar la ventana de Outlook
hWnd := FindWindow("OlMainFrame", NIL)
RETURN hWnd != 0
Code: Select all | Expand
Error: Unresolved external '_HB_FUN_GETPROCESSLIST' referenced from C:\ACBRREAL\
ACBRREAL.OBJ
Code: Select all | Expand
/*
* Verificar se um Exe esta sendo executado e podendo at‚ derruba-lo
* Parametros: _cExe, _nKill
* Retorno: Retorno - .t. se estiver rodando
*
* Autor: toya
*/
#include "FiveWin.ch"
FUNCTION Main()
LOCAL _cExe := "OutLook.exe", _nKill := 2, lOk
lOk := EstaRodandoKillExe( _cExe, _nKill )
? lOk
RETURN NIL
// Is the executable running?
FUNCTION EstaRodandoKillExe( _cExe, _nKill )
LOCAL Retorno := .F.
LOCAL oScriptObj
LOCAL oWmiService
LOCAL oListaProcess
LOCAL oProcessos
hb_default( @_nKill, 0 )
oScriptObj := CREATEOBJECT( "wbemScripting.SwbemLocator" )
oWmiService := oScriptObj:ConnectServer()
oListaProcess := oWmiService:ExecQuery( "select * from Win32_Process where Name='" + _cExe + "'" )
FOR EACH oProcessos in oListaProcess
Retorno := .T.
IF _nKill == 2
oProcessos:Terminate() // mata o _cEXE
ENDIF
NEXT
RETURN( Retorno )
FUNCTION hb_default( xVar, xValue ) // Only xHarbour
IF ValType( xVar ) != ValType( xValue )
xVar := xValue
ENDIF
RETURN NIL
// FIN / END - kapiabafwh@gmail.com