Что нового

Удаление иконок закрытых приложений из трея

Tuxzer92

Новичок
Сообщения
64
Репутация
0
Здравствуйте, возникла проблема. В системном трее кодеки и другие программы после работы оставляют свои иконки и при наведении на них они исчезают.
Можно ли как-то с помощью autoit сделать принудительное обновление трея, чтобы убрать эти иконки?

Спасибо!
 

InnI

AutoIT Гуру
Сообщения
4,912
Репутация
1,429
Tuxzer92
обновление трея, чтобы убрать эти иконки
AutoIt3Wrapper, в случае принудительного завершения скрипта, для чистки трея использует следующую функцию
Код:
Func _RefreshSystemTray($nDelay = 1000)
	; Save Opt settings
	Local $oldMatchMode = Opt("WinTitleMatchMode", 4)
	Local $oldChildMode = Opt("WinSearchChildren", 1)
	Local $error = 0
	Do; Pseudo loop
		Local $HWindow = WinGetHandle("classname=TrayNotifyWnd")
		If @error Then
			$error = 1
			ExitLoop
		EndIf
		Local $hControl = ControlGetHandle($HWindow, "", "Button1")
		; We're on XP and the Hide Inactive Icons button is there, so expand it
		If $hControl <> "" And ControlCommand($HWindow, "", $hControl, "IsVisible", "") Then
			ControlClick($HWindow, "", $hControl)
			Sleep($nDelay)
		EndIf
		Local $posStart = MouseGetPos()
		Local $posWin = WinGetPos($HWindow)
		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($HWindow, "", $hControl, "IsVisible", "") Then
			ControlClick($HWindow, "", $hControl)
		EndIf
	Until 1
	; Restore Opt settings
	Opt("WinTitleMatchMode", $oldMatchMode)
	Opt("WinSearchChildren", $oldChildMode)
	SetError($error)
EndFunc   ;==>_RefreshSystemTray
 
Автор
T

Tuxzer92

Новичок
Сообщения
64
Репутация
0
Запускаю TrueConf, убиваю его, в трее остается иконка, выполняю функцию, но иконка не пропадает.
ЧЯДНТ?
 
Верх