Forum Discussion

mzielinski1's avatar
mzielinski1
New Contributor
15 years ago

How to get Window XP Notification Tray items/Task bar icon count and buttons.

I am looking to check the icons in the notification tray to see if an icon is present. I have the code for a Windows 7 and it works but when I try to run on  XP it is not valid. I am using the code below for the Windows 7. I am also using JScript. Any help on this would be great.




var chl =Sys.Process("Explorer").Window("Shell_TrayWnd", "", 1).Window("TrayNotifyWnd", "", 1).Window("SysPager", "", 1).Window("ToolbarWindow32", "User Promoted Notification Area", 1).wButtonCount;

   for (var ts =0; ts < chl;ts++)

   {

        if (Sys.Process("Explorer").Window("Shell_TrayWnd", "", 1).Window("TrayNotifyWnd", "", 1).Window("SysPager", "", 1).Window("ToolbarWindow32", "User Promoted Notification Area", 1).wButtonText(ts).toUpperCase() == "WHAT I AM LOOKING FOR")

        {

           Log.Checkpoint("WHAT I AM LOOKING FOR Icon located in task bar");  

           fnd =true;      

           break;   

        }

   }

1 Reply

  • Found it

    Sys.Process("Explorer").Window("Shell_TrayWnd", "", 1).Window("TrayNotifyWnd", "", 1).Window("SysPager", "", 1).Window("ToolbarWindow32", "Notification Area", 1);