ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opened applications (https://www.excelbanter.com/excel-programming/440778-opened-applications.html)

Patrick[_18_]

Opened applications
 
Hello,

Would it be possible to list all the opened applications/windows that a user
sees in the taskbar?
I know how to list the running processes, but two windows can have the same
process.

Thank you in advance for any suggestion.
Regards



Steve Yandl[_3_]

Opened applications
 
Patrick,

You can use "Tasks" if you open an instance of MS Word. The example below
is a bare bones approach; you would probably want to check if Word is
already open etc. but this will give you a start. The 'Name' property of a
given task is the friendly name (title bar type name) rather than the
process name (which is often different).

'------------------------------------------

Sub ListVisibleWindows()
Set objWord = CreateObject("Word.Application")
For Each myTask In objWord.Tasks
If myTask.Visible Then
MsgBox myTask.Name
End If
Next myTask
objWord.Quit
Set objWord = Nothing
End Sub
'------------------------------------------

Steve Yandl

"Patrick" wrote in message
...
Hello,

Would it be possible to list all the opened applications/windows that a
user sees in the taskbar?
I know how to list the running processes, but two windows can have the
same process.

Thank you in advance for any suggestion.
Regards



All times are GMT +1. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com