Re: Screen device name?
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