You can probably just use SendMessage with WM_CLOSE.
If that doesn't work, you could also send 'Alt+Space' and then 'c' to activate the window menu and select the 'close' option. That should force-close any console programs.
-- Jeff
Edited 1 time(s). Last edit at 05/20/2010 02:29PM by jeff.