Re: Screen device name?
Re: Screen device name?
- Subject: Re: Screen device name?
- From: John Stiles <email@hidden>
- Date: Wed, 6 Sep 2006 14:45:30 -0700
I have old, old Carbon code which does this:
GDHandle currentMonitor = /* ... */;
DisplayIDType displayID;
Str255 displayName;
DMGetDisplayIDByGDevice( currentMonitor, &displayID, true );
DMGetNameByAVID( displayID, nil, displayName );
CopyPascalStringToC( displayName, displayName );
According to the docs this is deprecated in 10.4 (with the general
deprecation of QuickDraw). The docs say to "Use Quartz Display
Services instead," which is a pretty open-ended statement;
unfortunately it doesn't get any more specific.
On Sep 6, 2006, at 2: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:
40blizzard.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