Since a given process might have any number of windows, there's no single
answer to your question. If you're trying to close all top level windows
for some process, you could use EnumWindows( functionname, processid ) and
have the enumeration callback (functionname), check the process ID returned
by GetWindowThreadProcessId() against the parameter. If equal, it could
post a WM_CLOSE to the window or whatever. However, this is going to be a
challenge to do in the Compact Framework, as there's no built-in support for
using callback-required API functions like EnumWindows. Search the archives
for "enumwindows" and see what you can find on that strategy.
You might alternatively try calling GetWindow with suitable parameters over
and over until all windows have been enumerated (after getting each window
handle, you'd call GetWindowThreadProcessId() and see if it's a window from
the process that you want).
Paul T.