How does one gracefully kill a process in Windows?

https://superuser.com/questions/959364/on-windows-how-can-i-gracefully-ask-a-running-program-to-terminate

taskkill will do it, it sends WM_CLOSE messages to the target process.

Caveat - If a process is hung, it wouldn't be able to respond to your request to gracefully exit anyway.