Highlighted
Alan Abreu Absent Member.
Absent Member.
181 views

Is It Possible To Verify Icons In The System Tray?

Jump to solution
Is it possible to verify that an icon is or is not in the system tray?
0 Likes
1 Solution

Accepted Solutions
Henry Floyd Absent Member.
Absent Member.

Re: Is It Possible To Verify Icons In The System Tray?

Jump to solution
I can't think of a way to verify the icon in the tray, but you can verify the process is running on the computer.

You can try the code below to get the current running processes.

Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strList

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")

For Each objProcess in colProcess
Print objProcess.Name & vbCr
Next

View solution in original post

3 Replies
Henry Floyd Absent Member.
Absent Member.

Re: Is It Possible To Verify Icons In The System Tray?

Jump to solution
I can't think of a way to verify the icon in the tray, but you can verify the process is running on the computer.

You can try the code below to get the current running processes.

Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strList

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")

For Each objProcess in colProcess
Print objProcess.Name & vbCr
Next

View solution in original post

Alan Abreu Absent Member.
Absent Member.

Re: Is It Possible To Verify Icons In The System Tray?

Jump to solution
That will work out great. I can just verify that the specific process is or is not in the list of running processes.

Thanks Henry.
0 Likes
Krishna Kolacha Absent Member.
Absent Member.

Re: Is It Possible To Verify Icons In The System Tray?

Jump to solution
Alan,
the system tray can be added to your OR with the following properties:
text:=Notification Area
nativecalss:=ToolbarWindow32

Print Window("Window").WinToolbar("Notification Area").GetItemsCount ' should get you the number of items in notification area
Print Window("Window").WinToolbar("Notification Area").GetContent ' should get you the names of all items in the tray, then all you have to do is to look for a specific name of whatever app you are interested in within the string returned by GetContent, say, by using Instr function.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.