Re: How to distinguish between different MS Teams statuses

2021-07-23 Thread Gabriel Zachmann via Cocoa-dev
>> So far, i have been checking whether or not MS Teams is running by the 
>> following snippet (omitting some of the safety guards):
> 
> That code is answering the wrong question. It might appear to provide the 
> state of some running apps, but all it actually does is indicate the presence 
> of some particularly-named windows.

I know it is a very crude heuristic.
But so far it has worked well enough to keep it, I think.

> - What happens when the user happens to be editing a document in another app 
> (say, TextEdit) whose name happens to be "Microsoft Teams"? (Or "Zoom"? etc.)

Right, like I said, it's just a heuristic ...
But no harm will arise in those cases.

> - What happens when Microsoft revises their UI in a future version such that 
> the window is called something else?

Then I will need to update my app.

> The window-enumeration approach is coarse and fragile at best.

Yes, i know.

But not checking whether a video conferencing is taking place at the moment 
would annoy users (including myself) much more, because my app would then barge 
into a video conference (it goes full-screen automatically, depending on the 
user's preferences, which the other video conferencing parties won't see, but 
it's still kind of annoying).

Best regards, Gabriel



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to distinguish between different MS Teams statuses

2021-07-23 Thread Gabriel Zachmann via Cocoa-dev
> It seems that it would be tough.  How can you check if it’s happening in a 
> browser?

yes, any video conferencing via browser is pretty much undetectable , I guess.
That is OK.

I would be happy if I could detect some of the more common video conferencing 
tools.
With Zoom, Webex, and GoToMeeting, my method works pretty well.

> And what if I move the window to the other monitor?

Then it's fine , too, because in that case there is no conflict of screen 
resources.

Best regards, Gabriel



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to distinguish between different MS Teams statuses

2021-07-22 Thread Alex Zavatone via Cocoa-dev
It seems that it would be tough.  How can you check if it’s happening in a 
browser?
And what if I move the window to the other monitor?

> On Jul 22, 2021, at 12:45 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> My questions is quite simple:
> is it possible to determine - in my own app - whether or not there is an MS 
> Teams video call taking place at the moment?
> 
> So far, i have been checking whether or not MS Teams is running by the 
> following snippet (omitting some of the safety guards):
> 
> let mainScreen = NSScreen.main
> let options : CGWindowListOption = [.excludeDesktopElements , 
> .optionOnScreenOnly ]
> let winArray = CGWindowListCopyWindowInfo(options, kCGNullWindowID) as? [[ 
> String : Any]]   
> let win_name : String = winInfo[kCGWindowName as String] as? String
>?? winInfo[kCGWindowOwnerName as String] 
> as? String
>?? "???"
> if ( win_name == "Microsoft Teams" ) 
>increment counter for that VC Tool
> 
> This works pretty well for other kinds of VC tools, such as Zoom and Webex.
> 
> But with MS Teams, it does not quite work.
> 
> With other VC tools, there is usually two windows, the second one being 
> created only when an actual video call is occurring at the moment.
> Not so with MS Teams. It always has only one window.
> 
> The problem is that even if a video call is going on, the window's name is 
> only "Microsoft Teams".
> 
> So, I was wondering if there is any other method how I could detect whether 
> or not a video call in MS Teams is taking place.
> 
> 
> Best regards, Gabriel
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to distinguish between different MS Teams statuses

2021-07-22 Thread Ben Kennedy via Cocoa-dev


> On 22 Jul 2021, at 10:45 am, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> is it possible to determine - in my own app - whether or not there is an MS 
> Teams video call taking place at the moment?

The only correct answer to that depends on whether Microsoft Teams provides API 
that vends such information.

> So far, i have been checking whether or not MS Teams is running by the 
> following snippet (omitting some of the safety guards):

That code is answering the wrong question. It might appear to provide the state 
of some running apps, but all it actually does is indicate the presence of some 
particularly-named windows.

Consider:

- What happens when the user happens to be editing a document in another app 
(say, TextEdit) whose name happens to be "Microsoft Teams"? (Or "Zoom"? etc.)
- What happens when Microsoft revises their UI in a future version such that 
the window is called something else?

The window-enumeration approach is coarse and fragile at best.

-ben

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to distinguish between different MS Teams statuses

2021-07-22 Thread Gabriel Zachmann via Cocoa-dev
My questions is quite simple:
is it possible to determine - in my own app - whether or not there is an MS 
Teams video call taking place at the moment?

So far, i have been checking whether or not MS Teams is running by the 
following snippet (omitting some of the safety guards):

let mainScreen = NSScreen.main
let options : CGWindowListOption = [.excludeDesktopElements , 
.optionOnScreenOnly ]
let winArray = CGWindowListCopyWindowInfo(options, kCGNullWindowID) as? [[ 
String : Any]]   
let win_name : String = winInfo[kCGWindowName as String] as? String
?? winInfo[kCGWindowOwnerName as String] 
as? String
?? "???"
if ( win_name == "Microsoft Teams" ) 
increment counter for that VC Tool

This works pretty well for other kinds of VC tools, such as Zoom and Webex.

But with MS Teams, it does not quite work.

With other VC tools, there is usually two windows, the second one being created 
only when an actual video call is occurring at the moment.
Not so with MS Teams. It always has only one window.

The problem is that even if a video call is going on, the window's name is only 
"Microsoft Teams".

So, I was wondering if there is any other method how I could detect whether or 
not a video call in MS Teams is taking place.


Best regards, Gabriel



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com