VB6 怎么让MSGBOX显示在顶层 并且3秒后自动关闭
2个回答
2013-06-03
展开全部
'生成exe文件后有效'其实你可以再添加个form来实现,还有其他方法,,,Option Explicit
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 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Const WM_CLOSE = &H10Private Sub Command1_Click()
Timer1.Interval = 3000
MsgBox "abcde"
End SubPrivate Sub Timer1_Timer()
Dim hWnd As Long
hWnd = FindWindow(vbNullString, "工程1")
Call SendMessage(hWnd, WM_CLOSE, 0, ByVal 0&)
Timer1.Enabled = False
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 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Const WM_CLOSE = &H10Private Sub Command1_Click()
Timer1.Interval = 3000
MsgBox "abcde"
End SubPrivate Sub Timer1_Timer()
Dim hWnd As Long
hWnd = FindWindow(vbNullString, "工程1")
Call SendMessage(hWnd, WM_CLOSE, 0, ByVal 0&)
Timer1.Enabled = False
End Sub
2013-06-03
展开全部
新建工程之后,在软件右边(默认)修改属性,至于3秒关闭,你是想退出程序还是想后台执行?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询