sendmessage(handle,wm_close,0,0);
或者用
postmessage(handle,wm_close,0,0);
其中handle为要关闭的程序的句柄