VB托盘换图标程序,这样写为什么在最小化后无法显示窗体?
VB托盘程序中原有TrayAddIcon,它加载的是FORM1的图标,这个一切正常.
但我希望在转换功能时更换托盘图标,所以加了个TrayAddIcon1,让它加载FORM3的图标.
这样实现更换托盘图标.
可是问题出来了:
当我在TrayAddIcon1图标状态时将窗体最小化隐藏了窗体,点这个更换后的图标却无法再打开窗体了.
求VB高手帮帮忙解决这样的问题.
Public Sub TrayAddIcon(ByVal MyForm As Form, ByVal ToolTip As String, Optional ByVal bFlag As bFlag)
With ni
.cbSize = Len(ni)
.hwnd = MyForm.hwnd
.uID = vbNull
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Form1.Icon
.szTip = ToolTip & vbNullChar
End With
Call Shell_NotifyIcon(NIM_ADD, ni)
End Sub
Public Sub TrayAddIcon1(ByVal MyForm As Form, ByVal ToolTip As String, Optional ByVal bFlag As bFlag)
With ni
.cbSize = Len(ni)
.hwnd = MyForm.hwnd
.uID = vbNull
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Form3.Icon
.szTip = ToolTip & vbNullChar
End With
Call Shell_NotifyIcon(NIM_ADD, ni)
End Sub
[解决办法]
mark
[解决办法]
mark
[解决办法]
图标单击事件里的代码呢
[解决办法]
光看这个是看不出问题的吧...
起码得帖上有tray_click的code