vb.net,知道一个窗口的标题,窗口正在运行,如何使程序在该窗口关闭时Msgbox"窗口已关闭"
vb.net,知道一个窗口的标题,例如“test.doc-microsoftword”,窗口正在运行,如何使程序在该窗口关闭时Msgbox"窗口已关闭"。谢谢...
vb.net,知道一个窗口的标题,例如“test.doc-microsoft word”,窗口正在运行,
如何使程序在该窗口关闭时Msgbox"窗口已关闭"。谢谢 展开
如何使程序在该窗口关闭时Msgbox"窗口已关闭"。谢谢 展开
2个回答
展开全部
Private Declare Auto Function FindWindow Lib "user32" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Integer
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim hWnd As Integer
do
hWnd = FindWindow(vbNullString, "窗体名")
My.Application.DoEvents()
loop until hwnd=0
msgbox "窗口已关闭"
End Sub
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Integer
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim hWnd As Integer
do
hWnd = FindWindow(vbNullString, "窗体名")
My.Application.DoEvents()
loop until hwnd=0
msgbox "窗口已关闭"
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询