首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

任务栏图标闪烁,该怎么处理

2012-01-23 
任务栏图标闪烁我用如下方法修改任务拦图标,但是总不成功!请问是为什么FunctionIcon_Modify(hIconAsLong)A

任务栏图标闪烁
我用如下方法修改任务拦图标,但是总不成功!请问是为什么
Function   Icon_Modify(hIcon   As   Long)   As   Long
    Dim   ano   As   NOTIFYICONDATA
   
    ano.hIcon   =   hIcon
    ano.uFlags   =   NIF_ICON
   
    Icon_Modify   =   Shell_NotifyIcon(NIM_MODIFY,   ano)
End   Function

[解决办法]
加个Flag状态开关bTrayIconDisplayed
Public Function ShowTrayIcon() As Boolean

If Not bTrayIconDisplayed Then
bTrayIconDisplayed = Shell_NotifyIcon(NIM_ADD, ano )
If ShowTrayIcon= False Then
'debug.print "error! "
Else
bTrayIconDisplayed = True
End If
End If

End Function
[解决办法]
加个Flag状态开关bTrayIconDisplayed
Public Function ShowTrayIcon() As Boolean

If Not bTrayIconDisplayed Then
ShowTrayIcon= Shell_NotifyIcon(NIM_ADD, ano )
If ShowTrayIcon= False Then
'debug.print "error! "
Else
bTrayIconDisplayed = True
End If
End If

End Function
[解决办法]
ano.cbSize = Len(ano)
ano.hwnd = Form1.hwnd
ano.uId = vbNull
ano.uFlags = NIF_ICON
ano.hIcon = hIco

[解决办法]
先要initialize
Private Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * MAX_TIP_LENGTH
End Type

With ano
.cbSize = LenB(ano)
.hIcon = hIcon
.hwnd = hwnd
.szTip = Left(sTip, MAX_TIP_LENGTH - 1) & vbNullChar
'.uCallbackMessage = uCallbackMessage
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
.uId = vbNull
End With
bIconDisplayed = False
[解决办法]
一个timmer控件 在控件中做2个图表替换
[解决办法]
这里有你所要的关于Icon in System Tray.
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=45685&lngWId=1

热点排行