I'm not quite shure if I know what you mean, but here's two attempts.
1: Closes the active window if it's title contains PopTray
#SingleInstace,Force
WinGetActiveTitle,title
IfInString,title,PopTray
Send,{Esc}
Sleep,100
2: Closes all windows with title containing PopTray
#SingleInstace,Force
SetTitleMatchMode,2
Loop
{
IfWinExist,PopTray
WinClose,PopTray
Sleep,100
}