Upon starting an application, I would like to be able to kill a certain process or app that shows in the Task Manager as FtLnSOP.exe. Manually, I can do it by right clicking it and asking "Kill the process tree". Is there any way of achieving the same from the program?
Thanks
Rafael
How to kill a process
- Rafael Clemente
- Posts: 365
- Joined: Sat Oct 08, 2005 7:59 pm
- Location: Barcelona, Spain
Re: How to kill a process
Este link te puede servirRafael Clemente wrote:Upon starting an application, I would like to be able to kill a certain process or app that shows in the Task Manager as FtLnSOP.exe. Manually, I can do it by right clicking it and asking "Kill the process tree". Is there any way of achieving the same from the program?
Thanks
Rafael
Utilizando wmi, se pueden hacer muchas cosillas
Saludos
William, Morales
Saludos
méxico.sureste
Saludos
méxico.sureste
-
- Posts: 142
- Joined: Sun Oct 09, 2005 10:59 am
Rafael
Here you have an example.
In this example shellexecute starts wordpad with efkes.rtf. The use has to close this aplication first before continuing. If this not occured , the program will do that.
Here you have an example.
In this example shellexecute starts wordpad with efkes.rtf. The use has to close this aplication first before continuing. If this not occured , the program will do that.
Code: Select all
Shellexecute(0 ,0 , "C:\TEMP\efkes.rtf" ,0 ,0 , 1)
hWnd := FINDWND( "EFKES.RTF" )
? "Atention , wordpad must be closed correctly"
DO WHIL .T.
hWnd := FINDWND( "EFKES.RTF" )
IF ! EMPTY( hWnd )
? "the aplication closes Winword"
SENDMESSAGE( hWnd, 16 )
End
END
-
- Posts: 142
- Joined: Sun Oct 09, 2005 10:59 am
Missing FindWnd()
Code: Select all
// from http://fivetechsoft.com/forums/viewtopic.php?t=1346&start=0&postdays=0&postorder=asc&highlight=findwindow%2A
#define GW_HWNDFIRST 0
#define GW_HWNDLAST 1
#define GW_HWNDNEXT 2
#define GW_HWNDPREV 3
#define GW_OWNER 4
#define GW_CHILD 5
FUNCTION FINDWND( cTitle )
LOCAL hWnd := GETWINDOW( GETDESKTOPWINDOW(), GW_CHILD )
WHILE hWnd != 0
IF UPPER( cTitle ) $ UPPER( GETWINDOWTEXT( hWnd ) )
RETURN hWnd
ENDIF
hWnd = GETWINDOW( hWnd, GW_HWNDNEXT )
ENDDO
RETURN NIL
- Rafael Clemente
- Posts: 365
- Joined: Sat Oct 08, 2005 7:59 pm
- Location: Barcelona, Spain
Frank:
Thank you for your suggestion. The problem is that I do not know the Window title of the program to kill; only its name as it appears in the Task Manager, i.e: "FtLnSOP.exe"
Any other suggestion? _'s sollution seems promising, but at present I have been unabe to compile his example (see Spanish Forum).
Regards,
Rafael
Thank you for your suggestion. The problem is that I do not know the Window title of the program to kill; only its name as it appears in the Task Manager, i.e: "FtLnSOP.exe"
Any other suggestion? _'s sollution seems promising, but at present I have been unabe to compile his example (see Spanish Forum).
Regards,
Rafael
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Rafael Clemente
- Posts: 365
- Joined: Sat Oct 08, 2005 7:59 pm
- Location: Barcelona, Spain
- Rafael Clemente
- Posts: 365
- Joined: Sat Oct 08, 2005 7:59 pm
- Location: Barcelona, Spain