kill process ?

hello
sorry for my bad english

i would like to kill a process with a function in a desktopx object.
i found this code:
====================
Dim p() As Process
Dim r As Process
p = Process.GetProcessesByName("msiexec")
For Each r In p
r.CloseMainWindow()
Next
====================
My script is like that:

Dim Filepath
Dim sh

Sub Object_OnScriptEnter
DesktopX.Object("CRT_SetPoint_Base").State = "SetpointVert"
Filepath = "C:\Program Files\Logitech\SetPoint\SetPoint.exe"
End Sub

Function Object_OnLButtonDown(x, y)
If object.state = "SetpointVert" Then
Dim p() 'As Process
Dim r 'As Process
p = Process.GetProcessesByName("SetPoint")
For Each r In p
r.CloseMainWindow()
Next
object.state = "SetpointRouge"

ElseIf object.state = "SetpointRouge" Then
Set Sh = CreateObject("WScript.Shell")
Sh.Run (Chr(34)& FilePath & Chr(34))
Set Sh = Nothing
object.state = "SetpointVert"
End If
End Function



but it's report that "there has been a script in object "CRT_SetPoint_Base"
Dim p() As Process
and if i dont put "As Process" it's report that Object 'Process' is not found

need help please thank you

1,270 views 0 replies