Script ListTaskTrayIcons () ;Contribution de Paul, liste Jaws-script var handle hWnd, object o, int iLeft, int iTop, int iRight, int iBottom, int ScreenHeight, int ScreenWidth, string sRectItemList, string sTemp, int MagicState, int iTetherOption, ; Turn off TetherJAWSToPC int iVPCOption, ;Turn off Virtual PC Cursor int nItems, int nIdx, int nButton, string strTip, string GraphicList if (InHJDialog ()) then SayFormattedMessage (OT_error, cMSG337_L, cMSG337_S) return endIf let ScreenHeight = ScreenGetHeight () let ScreenWidth = ScreenGetWidth () let MagicState = MagGetState () let iTetherOption = GetDefaultJCFOption (OPT_TETHER_JAWS_TO_PC) Let iVPCOption = GetJcfOption (OPT_VIRTUAL_PC_CURSOR) ; Temporarily turn off the Tether JAWS to PC option SetDefaultJcfOption (OPT_TETHER_JAWS_TO_PC, 0) SetJcfOption (OPT_VIRTUAL_PC_CURSOR, 0) ; recherche de la fenetre contenant les applications en cours d'exécution let hWnd = GetAppMainWindow (GetFocus()) let hWnd = GetFirstWindow (hWnd) let nIdx = 0 while nIdx <150 &&hWnd if GetWindowClass(hWnd) == "Shell_TrayWnd" then let nIdx=200 else let hWnd = GetNextWindow (hWnd) let nIdx=nIdx+1 endif endwhile if nIdx == 200 then let hWnd = FindWindow(hWnd,"SysPager", "") if hWnd then let hWnd = FindWindow(hWnd, "ToolbarWindow32","") endif endif if hWnd == 0 then Say (cmsgListTaskTrayIconsError1, OT_ERROR) return endif ; recherche de l'object correspondant à cette fenetre GetWindowRect(hWnd,iLeft,iRight,iTop,iBottom) let o = GetObjectAtPoint(nIdx ,iLeft+(iRight-iLeft)/2, iTop+(iBottom-iTop)/2) let nItems = o.accChildCount if ( nItems <= 0 ) then Say (cmsgListTaskTrayIconsError1, OT_ERROR) return endIf ; construction de la liste des items de la barre des taches ; et construction de la liste des coordonnées de ces items let nIdx = 1 while nIdx <= nItems Let strTip = o.accName(nIdx) if (o.accState(nIdx)&STATE_SYSTEM_INVISIBLE)==0 && StringLength(strTip) then tbGetItemRect (hWnd, nIdx, iLeft, iRight, iTop, iBottom) let sTemp = IntToString(iLeft) + ","+intToString(iTop) let sTemp = sTemp+","+IntToString(iRight- iLeft)+","+IntToString(iBottom-iTop) let sRectItemList = sRectItemList + "|"+sTemp let GraphicList = GraphicList + LIST_ITEM_SEPARATOR + strTip endif let nIdx = nIdx + 1 EndWhile if ( 0 == StringLength (GraphicList) ) then Say (cmsgListTaskTrayIconsError1, OT_ERROR) return endIf let sRectItemList = StringChopLeft(sRectItemList,1) let nButton = DlgSysTray (GraphicList, nIdx) if (nIdx > 0 && nButton > 7000) then SaveCursor () if (MagicState > 0) then JAWSCursor () MoveTo (ScreenWidth - 2, ScreenHeight - 2) Delay (10, TRUE) endIf ; SysTrayMoveToItem (nIdx) let sTemp = StringSegment(sRectItemList,"|",nIdx) let iLeft = StringToInt(StringSegment(sTemp,"," , 1))+ StringToInt(StringSegment(sTemp , "," ,3))/2 let iTop = StringToInt(StringSegment(sTemp,"," , 2))+ StringToInt(StringSegment(sTemp , "," ,4))/2 JawsCursor() MoveTo (iLeft,iTop,False) if (MagicState > 0) then Delay (10, TRUE) endIF if (iD_RightSingleClick == nButton) then RightMouseButton () elif (iD_LeftSingleClick == nButton) then LeftMouseButton () elif (iD_LeftDoubleClick == nButton) then LeftMouseButton () LeftMouseButton () endIf RestoreCursor() endIf Pause () SetDefaultJcfOption (OPT_TETHER_JAWS_TO_PC, iTetherOption) SetJcfOption (OPT_VIRTUAL_PC_CURSOR, iVPCOption) endscript