You can control line endings on all lines as well as widows and orphans by making your hyphenation zone larger or smaller forcing fewer or more words to hyphenate. However, hyphenation can create its own dangling words. One type of widow or orphan I hope you'll always try to correct is the hyphenated word left sitting at the top or bottom of a column. It's at its worst when the hyphenated word is split between two different pages of the document. It looks bad but it also makes it harder on your reader.
If you have many dangling word parts throughout a document you may need to readjust the automatic hyphenation settings of your software. If it is just an occasional hyphenated widow or orphan then make individual adjustments by tightening or loosening the character spacing of the affected words.