先用findwindow得到你要查的窗口的hwnd,然后用sendmessge yourform.hwnd,wm_close,0 private button1_click() dim tmp as long tmp=findwindow(vbnullstring,"程序的窗口名VB中FORM的NAME属性值") if tmp > 0 then sendmessage tmp,wm_close,0 else msgbox "Sorry!Don't find formname" end if end sub