Does anyone have example code of how to close a window/process with only the name of the window?

Not sure if this should be in API or C# section...