I need to figure a way to kill a child process using SilkTest. For example: if the application under test crash's, I need to be able to terminate all the process's that the application launch's. I am able to kill the process for the application using the GetWindowThreadProcessId API call but that doesn't work for any lingering process's created when invoking the app.
That would be one way to do it. I would just prefer to do it behind the scenes. I have experienced instances using SilkTest where the tool would randomly fail to do what was requested for some unexplainable reason. Doing an API call seemed to be the most reliable way. I have found a couple of API's called EnumProcesses and GetModuleBaseName from psapi.h that appears to be the answer to my problem but I'm having trouble implementing them in SilkTest as my knowledge of c++ is very limited and I'm not completely understanding the functions. psapi.h is installed with Microsoft's platform sdk
I've been using GetAppID() and kill.exe to kill a process. It sounds like you're situation is a bit more complicated? If you know the list of process that are spawned, you can certainly use kill.exe. I agree strongly about doing things behind the scenes, definitely the way to go. I'm thinking about posting a request for people to share their WinAPI declarations. It would be really cool to have such a resource.