Woah, you used my DLL.
I'd better help you :)
The value returned by the RunProgram function is actually a process handle, which is completely different from a window handle.
(And not usable with window commands).
If you want, it may be possible to edit the source code of that DLL to acquire the handle of the executed program, and then use that to send window messages.
However, I believe there is actually a command to end a process somewhere - maybe in kernel32 - which would close it for you.
Of course, that's a very forceful close so not recommended.
I'll try to look this up for you...
There are a lot of process functions, so a few searches at MSDN should bring up good results.
Edit:
I've done a lot of explaining today, so I'm a bit fatigued... not even in sorting mode, actually, so this could be messy. Hope it helps though. I'll stick to the functions that can generally be used straight through B3d using the process handle returned by RunProgram:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecoreos5/html/wce50lrfexitprocess.aspFunction to end a process. I'm not sure how clean it is; could be instant process killing, which isn't very safe.
Mind, this is from the Windows CE API for some reason. Probably the same in regular desktop windows.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/process_and_thread_functions.aspList of process functions, which Blitz3d can hopefully use directly.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/child_processes.aspAll about processes.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getguiresources.aspI'm still trying to comprehend this one, but it seems to be (part of?) a way to find windows created by a process, which is extremely useful.
Otherwise, it's just a way to count how many windows a process has, which seems quite pointless.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/terminating_a_process.aspGeneral info on terminating a process.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/obtaining_additional_process_information.aspHow to obtain additional process information.
By the way, a lot of these functions can be found in kernel32.decls or user32.decls.
There are a few others, too...