• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Screen device name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Screen device name?


  • Subject: Re: Screen device name?
  • From: Spencer Salazar <email@hidden>
  • Date: Wed, 6 Sep 2006 17:43:05 -0400

Once you have the CGDirectDisplayID, you can call CGDisplayIOServicePort to get an IOKit-friendly io_service_t. You can then pass this to IODisplayCreateInfoDictionary, which returns a CFDictionary with a key kDisplayProductName, whose value is another CFDictionary of localized display names (from IOKit/ IOGraphicsTypes.h: "eg. "en"="Color LCD", "en-GB"="Colour LCD"").

Id like to think there is a more direct way than this, but as far as I can tell that is not the case.

spencer

On Sep 6, 2006, at 5:17 PM, Ricky Sharp wrote:


On Sep 6, 2006, at 2:51 PM, Trygve Inda wrote:

Given an NSScreen, how can I get the device name, e.g. "Cinema HD Display"?

There is no key for this in [NSScreen deviceDescription]

System Profiler is doing this somehow. My guess is with I/O kit.

CGDisplayModelNumber returns the "product ID" of the monitor (integer value). That API takes a CGDirectDisplayID which you can get out of your screen's dictionary.

How to then translate the product ID to a string is beyond me.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Screen device name?
      • From: Trygve Inda <email@hidden>
References: 
 >Screen device name? (From: Trygve Inda <email@hidden>)
 >Re: Screen device name? (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Screen device name?
  • Next by Date: Re: Screen device name?
  • Previous by thread: Re: Screen device name?
  • Next by thread: Re: Screen device name?
  • Index(es):
    • Date
    • Thread