@oregon a pensar male si fa peccato
@matpez
non è sicuramente la soluzione migliore però crea le condizioni di un refresh
codice:
Private Const WM_MOUSEMOVE = &H200
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias _
"GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Function FindWindowEx Lib "user32" Alias _
"FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function GetWindowRect Lib "user32" ( _
ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function PostMessage Lib "user32" Alias _
"PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Sub RefreshTray()
Dim osv As OSVERSIONINFO
Dim hwnd As Long
Dim r As RECT
Dim x As Long
osv.dwOSVersionInfoSize = Len(osv)
Call GetVersionEx(osv)
Select Case (osv.dwMajorVersion * 10) + osv.dwMinorVersion
Case 50
hwnd = FindWindowEx(FindWindowEx(FindWindowEx(0, 0, _
"Shell_TrayWnd", ""), 0, "TrayNotifyWnd", ""), 0, _
"ToolbarWindow32", "")
Case 51, 52
hwnd = FindWindowEx(FindWindowEx(FindWindowEx( _
FindWindowEx(0, 0, "Shell_TrayWnd", ""), 0, _
"TrayNotifyWnd", ""), 0, "SysPager", ""), 0, _
"ToolbarWindow32", "Notification Area")
Case Else ' altri OS Bho!
Exit Sub
End Select
Call GetWindowRect(hwnd, r)
For x = r.Left To r.Right
Call PostMessage(hwnd, WM_MOUSEMOVE, 0, _
((r.Bottom - r.Top) \ 2) * &HFFFF + x - r.Left)
Next
End Sub
per richiamarla
in pratica ho simulato il passaggio del mause sopra la tray