vb托盘提示时间

来源:百度知道 编辑:UC知道 时间:2024/06/06 18:15:35
现在就是把鼠标移到托盘那里就显示当前时间,但是时间是不动的.
怎样才能把鼠标移到到托盘图标上,而时间是动态活动的.

-----form1.frm----
Private Sub Form_Load()
Timer1.Interval = 1000
'载入系统托盘
TrayAddIcon Form1, App.Path & "\xptray.ico", "系统托盘"
End Sub
Private Sub Timer1_Timer()
TrayTip Form1, Now '将托盘提示显示为当前时间
End Sub
------module.bas-----
Option Explicit
Public s As String
'使用高分辨率图标所用的API
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal dwImageType As Long, ByVal dwDesiredWidth As Long, ByVal dwDesiredHeight As Long, ByVal dwFlags As Long) As Long
Private Const LR_LOADFROMFILE = &H10
Private Const LR_LOADMAP3DCOLORS = &H1000
Private Const IMAGE_ICON = 1
'系统托盘
Private Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICON

自己创建一个窗口,里面显示时间,移到图标上显示这个窗口

太长了

大哥,托盘已经有一个系统时间了,你还显示时间!

这里系统提供的 NIF_TIP 功能就是这样静止的,要改的话很麻烦啊,没必要