用什么API可以得到显示器的名字就像"Plus And Play Monitor"?
我的方法是:
先用EnumDisplayMonitors枚举出所有设备,得到的每个显示器的句柄再在它的回调FUNCTION中用GetMonitorInfo来获取每一个显示器的信息,但从返回的MONITORINFOEX结构中得到的szDevice是一些\\...\**的字符串,这好像是显示器的名字而不是显示器的描述字符串.
请教大侠们怎么样才能得到像"Plus And Play Monitor"的描述字符串呢?谢谢

解决方案 »

  1.   

    查询注册表Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96E-E325-11CE-BFC1-08002BE10318}\0000]
    "MaxResolution"="1600,1200"
    "DPMS"="1"
    "InfPath"="monitor.inf"
    "InfSection"="VESADDC.Install"
    "ProviderName"="Microsoft"
    "DriverDateData"=hex:00,40,6c,e7,9f,0b,bf,01
    "DriverDate"="10-1-1999"
    "MatchingDeviceId"="*pnp09ff"
    "DriverDesc"="即插即用监视器"[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96E-E325-11CE-BFC1-08002BE10318}\0000\MODES][HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96E-E325-11CE-BFC1-08002BE10318}\0000\MODES\1600,1200]
    @=""
      

  2.   

    GetMonitorInfoThe GetMonitorInfo function lets you obtain information about a display monitor. BOOL GetMonitorInfo(
      HMONITOR hMonitor,  // handle to display monitor
      LPMONITORINFO lpmi  // pointer to display monitor information 
    );
     
    Parameters
    hmonitor 
    Handle to the display monitor of interest. 
    lpmi 
    Pointer to a MONITORINFO structure or a MONITORINFOEX structure. The function stores information about the specified display monitor in this structure. 
    You must set the cbSize member of the structure to sizeof(MONITORINFO) or sizeof(MONITORINFOEX) before calling the GetMonitorInfo function. Doing so lets the function determine the type of structure you are passing to it. The MONITORINFOEX structure is a superset of the MONITORINFO structure. It has one additional member: a string member, to contain a name for the display monitor. Most applications have no use for a display monitor name, and so can save some bytes by using a MONITORINFO structure
      

  3.   

    我也想到过从注册表中获得,但这样的话不利于程序的维护,因为不同的操作系统平台上的主册表结构是不同的,所以如果将来MS推出的LONGHOME如果注册表结构再不一样,还得重新修改一次,不太爽.
    不过还得谢谢大家的关注.
      

  4.   

    我的题意就是,如何通过API获取显示器驱动的描述名称.