>Hi Sergey,
>
>in fact this is not I need, this function kills a process event but what I need is to take the form name which is working the desktop of windows for any other windows app. and then close it, like if you run calculator and close it within your function.
If you can get an hWnd for the WinApp, then you can use PostMessage() to send a WM_CLOSE to the hWnd. You can also get the ProcessHandle and use TerminateProcess() as documented in my API_APPRUN class.