VB程序最小化到托盘,但是点击托盘图标却弹不出来。 20
PrivateSubForm_Load()WebBrowser1.Silent=TrueWebBrowser1.Navigate"http://www.my-fm.cn/...
Private Sub Form_Load()
WebBrowser1.Silent = True
WebBrowser1.Navigate "http://www.my-fm.cn/"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Dim vdoc
Set vdoc = WebBrowser1.Document
For i = 0 To vdoc.All.length
If LCase(vdoc.All(i).Id) = "km" Then
MsgBox vdoc.All(i + 1).outertext & "||" & vdoc.All(i + 1).href
End If
Next i
End Sub
Private Sub Form_Resize()
If Form1.WindowState = 1 Then
nid.cbSize = Len(nid)
nid.uId = vbNull
nid.hWnd = Me.hWnd
nid.uFlags = NIF_TIP Or NIF_MESSAGE Or NIF_ICON
nid.uCallBackMessage = WM_MOUSEMOVE
nid.hIcon = Me.Icon
nid.szTip = "窗体最小化"
Shell_NotifyIcon NIM_ADD, nid
Me.Hide
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim msg As Long
msg = X / 15
If msg = WM_LBUTTONDBLCLK Then
Me.Show
Shell_NotifyIcon NIM_DELETE, nid
End If
End Sub 展开
WebBrowser1.Silent = True
WebBrowser1.Navigate "http://www.my-fm.cn/"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Dim vdoc
Set vdoc = WebBrowser1.Document
For i = 0 To vdoc.All.length
If LCase(vdoc.All(i).Id) = "km" Then
MsgBox vdoc.All(i + 1).outertext & "||" & vdoc.All(i + 1).href
End If
Next i
End Sub
Private Sub Form_Resize()
If Form1.WindowState = 1 Then
nid.cbSize = Len(nid)
nid.uId = vbNull
nid.hWnd = Me.hWnd
nid.uFlags = NIF_TIP Or NIF_MESSAGE Or NIF_ICON
nid.uCallBackMessage = WM_MOUSEMOVE
nid.hIcon = Me.Icon
nid.szTip = "窗体最小化"
Shell_NotifyIcon NIM_ADD, nid
Me.Hide
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim msg As Long
msg = X / 15
If msg = WM_LBUTTONDBLCLK Then
Me.Show
Shell_NotifyIcon NIM_DELETE, nid
End If
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询