TestComplete:How to identify my application icon in the system tray Notification area

StackOverflow https://stackoverflow.com/questions/21608724

  •  08-10-2022
  •  | 
  •  

質問

I need to locate my application from the Notification Area in the system tray.How can i make it work using the shortcut key Win +B for Win7 and Win8?

Thanks

役に立ちましたか?

解決

What do you want to do with the application? Launch it? The following sample right-clicks the icon in the system tray based on the app name:

 //JScript
    function RightClickTrayIcon(Name, ItemName)
    {
          var p, tray, show_button;
        // Gets the tray
        p = Sys.Process("Explorer");
        tray = p.Window("Shell_TrayWnd").Window("TrayNotifyWnd");
        show_button = tray.WaitWindow("Button", "");
        show_button.Click();
        aqUtils.Delay(1000);
        // Right-clicks the application icon
        tray.Window("SysPager").Window("ToolbarWindow32", "Notification Area").
            ClickItemR(Name);
        // Selects an item from the context menu
        tray.PopupMenu.Click(ItemName);
    }
    function TestClickTray()
    {
          RightClickTrayIcon("Volume", "Open Volume Control");
    }
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top