Page 1 sur 1
[R] "Actualiser" les icônes de notification
Posté : mer. 22 mai 2013 01:40
par Utilisateur 4989 supprimé
Bonjour,
comme tout le monde le sait, quand on fait un ProcessClose d'un logiciel, l'icône de notification du logiciel fermé ne s'enlève pas tant qu'on ne l'a pas survolé.
Ma question est : comment "actualiser" les icônes de notification pour enlever l'icône après un ProcessClose ?
Merci d'avance pour votre aide.
Re: [..] "Actualiser" les icônes de notification
Posté : mer. 22 mai 2013 10:06
par jguinch
Salut
J'ai retrouvé ça dans un de mes scripts... Je sais plus où j'avais récupéré ça.
► Afficher le texte_RefreshSystemTray
Code : Tout sélectionner
Func _RefreshSystemTray()
For $i = 0 To 5
; Save Opt settings
Local $oldMatchMode = Opt("WinTitleMatchMode", 4)
Local $oldChildMode = Opt("WinSearchChildren", 1)
Local $error = 0
Do
Local $hWnd = WinGetHandle("classname=TrayNotifyWnd")
If @error Then
$error = 1
ExitLoop
EndIf
Local $hControl = ControlGetHandle($hWnd, "", "Button1")
; We're on XP and the Hide Inactive Icons button is there, so expand it
If $hControl <> "" And ControlCommand($hWnd, "", $hControl, "IsVisible") Then
ControlClick($hWnd, "", $hControl)
Sleep(100)
EndIf
Local $posStart = MouseGetPos()
Local $posWin = WinGetPos($hWnd)
Local $y = $posWin[1]
While $y < $posWin[3] + $posWin[1]
Local $x = $posWin[0]
While $x < $posWin[2] + $posWin[0]
DllCall("user32.dll", "int", "SetCursorPos", "int", $x, "int", $y)
If @error Then
$error = 2
ExitLoop 3; Jump out of While/While/Do
EndIf
$x = $x + 8
WEnd
$y = $y + 8
WEnd
DllCall("user32.dll", "int", "SetCursorPos", "int", $posStart[0], "int", $posStart[1])
; We're on XP so we need to hide the inactive icons again.
If $hControl <> "" And ControlCommand($hWnd, "", $hControl, "IsVisible") Then
ControlClick($hWnd, "", $hControl)
EndIf
Until 1
; Restore Opt settings
Opt("WinTitleMatchMode", $oldMatchMode)
Opt("WinSearchChildren", $oldChildMode)
SetError($error)
Next
EndFunc ; _RefreshSystemTray()
Re: [..] "Actualiser" les icônes de notification
Posté : ven. 24 mai 2013 19:46
par Utilisateur 4989 supprimé
Merci beaucoup

Le petit problème est que ce code ne fait que les icônes visibles, pas celles qui sont masquées.
Re: [..] "Actualiser" les icônes de notification
Posté : ven. 24 mai 2013 22:05
par jguinch
Re: [..] "Actualiser" les icônes de notification
Posté : sam. 25 mai 2013 10:47
par Utilisateur 4989 supprimé
Merci, je vais potasser tout ça.
Merci pour ton aide

Sujet résolu.