API 关闭窗口
比如说 我新建了一个MDI窗体,然后有很多子窗体,在MDI内打开后 怎么用API函数关闭打开的子窗口,平常我们用的是UNLOAD ME 怎么用API函数替换这个功能
[解决办法]
使用SendMessage发送关闭命令给它即可
Private Declare Function SendMessage Lib "user32 " Alias "SendMessageA " (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Sub Command1_Click(Index As Integer) dim quit as long quit = SendMessage(hWnd, WM_CLOSE, 0, 0) END Sub