TestComplete:如何在系统托盘通知区域中标识我的应用程序图标

时间:2014-02-06 16:38:37

标签: testcomplete

我需要从系统托盘中的通知区域找到我的应用程序。如何使用快捷键Win + B为Win7和Win8工作?

由于

1 个答案:

答案 0 :(得分:1)

您想对该应用程序做什么?发射吗?以下示例根据应用程序名称右键单击系统托盘中的图标:

 //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");
    }
相关问题