VB 在EXPLORER进程崩溃之后重建托盘图标

重点为:向系统注册“TaskbarCreated”消息

Public Function Wndproc( ByVal hwnd As Long , ByVal Msg As Long , ByVal wParam As Long , ByVal lParam As Long ) As Long
If
Msg = lngMsgBarRester Then '重建托盘图标
FrmMain.cTray.InTray = False
FrmMain.cTray.InTray = True
End If
'交还控制权给系统继续监测热键
Wndproc = CallWindowProc(preWinProc, hwnd, Msg, wParam, lParam)
End Function

Sub
Main()
lngMsgBarRester = RegisterWindowMessage(
"TaskBarCreated" ) '注册任务栏创建的消息
End Sub

 

你可能感兴趣的:(vb)