VB 中的sendmessage的用法 高手进
我想用sendmessage给自己窗口发一个WM_CLOSE,达到结束自身的作用,代码是什么我记不得了!请高手帮忙写一下,越简单越好,那些一篇一篇复制张贴的给我滚出去!...
我想用sendmessage给自己窗口发一个WM_CLOSE,达到结束自身的作用,代码是什么我记不得了!请高手帮忙写一下,越简单越好,那些一篇一篇复制张贴的给我滚出去!
展开
2个回答
展开全部
用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 Const WM_CLOSE = &H10
Pirvate sub command1)Click()
SendMessage me.hwnd,WM_CLOSE,0,0
End Sub
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 Const WM_CLOSE = &H10
Pirvate sub command1)Click()
SendMessage me.hwnd,WM_CLOSE,0,0
End Sub
展开全部
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 Const WM_CLOSE = &H10
Private Sub Command1_Click()
SendMessage hwnd, WM_CLOSE, 0, 0
End Sub
Private Const WM_CLOSE = &H10
Private Sub Command1_Click()
SendMessage hwnd, WM_CLOSE, 0, 0
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询