Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can I get monitor and display specs/properties? #TS

How can I get monitor and display specs/properties? #TS

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorialannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tommy H D Svensson
    wrote on last edited by
    #1

    Hi all, I wish to programmatically determine the monitor frequency (in Hz), the video card name and its manufacturer and version. Any one has any clue? Is there anything similar to GetDeviceCaps...? (Where's the GetDeviceCapsEx when you need it!? :)) If you're saying WMI, then please show me how to use it cause I stumped big time... /T

    B 1 Reply Last reply
    0
    • T Tommy H D Svensson

      Hi all, I wish to programmatically determine the monitor frequency (in Hz), the video card name and its manufacturer and version. Any one has any clue? Is there anything similar to GetDeviceCaps...? (Where's the GetDeviceCapsEx when you need it!? :)) If you're saying WMI, then please show me how to use it cause I stumped big time... /T

      B Offline
      B Offline
      Bill Wilson
      wrote on last edited by
      #2

      WMI code is fairly complex and involved. It is too complicated to make up a solution for this problem. There are numerous examples of WMI usage on code project, code guru and in MSDN. I have some code I used to interrogate system performance data, but it is quite different from what you will need. Here's a start from MSDN: Use this provider first:

      class Win32_VideoSettings : CIM_VideoSetting
      {
      Win32_VideoController ref Element ;
      CIM_VideoControllerResolution ref Setting ;
      };

      Then interogate for the specific controller:

      class Win32_VideoController : CIM_PCVideoController
      {
      uint16 AcceleratorCapabilities[] ;
      string AdapterCompatibility ;
      string AdapterDACType ;
      uint32 AdapterRAM ;
      uint16 Availability ;
      string CapabilityDescriptions[] ;
      string Caption ;
      uint32 ColorTableEntries ;
      uint32 ConfigManagerErrorCode ;
      boolean ConfigManagerUserConfig ;
      string CreationClassName ;
      uint32 CurrentBitsPerPixel ;
      uint32 CurrentHorizontalResolution ;
      uint64 CurrentNumberOfColors ;
      uint32 CurrentNumberOfColumns ;
      uint32 CurrentNumberOfRows ;
      uint32 CurrentRefreshRate ;
      uint16 CurrentScanMode ;
      uint32 CurrentVerticalResolution ;
      string Description ;
      string DeviceID ;
      uint32 DeviceSpecificPens ;
      uint32 DitherType ;
      datetime DriverDate ;
      string DriverVersion ;
      boolean ErrorCleared ;
      string ErrorDescription ;
      uint32 ICMIntent ;
      uint32 ICMMethod ;
      string InfFilename ;
      string InfSection ;
      datetime InstallDate ;
      string InstalledDisplayDrivers ;
      uint32 LastErrorCode ;
      uint32 MaxMemorySupported ;
      uint32 MaxNumberControlled ;
      uint32 MaxRefreshRate ;
      uint32 MinRefreshRate ;
      boolean Monochrome ;
      string Name ;
      uint16 NumberOfColorPlanes ;
      uint32 NumberOfVideoPages ;
      string PNPDeviceID ;
      uint16 PowerManagementCapabilities[] ;
      boolean PowerManagementSupported ;
      uint16 ProtocolSupported ;
      uint32 ReservedSystemPaletteEntries ;
      uint32 SpecificationVersion ;
      string Status ;
      uint16 StatusInfo ;
      string SystemCreationClassName ;
      string SystemName ;
      uint32 SystemPaletteEntries ;
      datetime TimeOfLastReset ;
      uint16 VideoArchitecture ;
      uint16 VideoMemoryType ;
      uint16 VideoMode ;
      string VideoModeDescription ;
      string VideoProcessor ;
      };

      Hope this helps, Bill

      L 1 Reply Last reply
      0
      • B Bill Wilson

        WMI code is fairly complex and involved. It is too complicated to make up a solution for this problem. There are numerous examples of WMI usage on code project, code guru and in MSDN. I have some code I used to interrogate system performance data, but it is quite different from what you will need. Here's a start from MSDN: Use this provider first:

        class Win32_VideoSettings : CIM_VideoSetting
        {
        Win32_VideoController ref Element ;
        CIM_VideoControllerResolution ref Setting ;
        };

        Then interogate for the specific controller:

        class Win32_VideoController : CIM_PCVideoController
        {
        uint16 AcceleratorCapabilities[] ;
        string AdapterCompatibility ;
        string AdapterDACType ;
        uint32 AdapterRAM ;
        uint16 Availability ;
        string CapabilityDescriptions[] ;
        string Caption ;
        uint32 ColorTableEntries ;
        uint32 ConfigManagerErrorCode ;
        boolean ConfigManagerUserConfig ;
        string CreationClassName ;
        uint32 CurrentBitsPerPixel ;
        uint32 CurrentHorizontalResolution ;
        uint64 CurrentNumberOfColors ;
        uint32 CurrentNumberOfColumns ;
        uint32 CurrentNumberOfRows ;
        uint32 CurrentRefreshRate ;
        uint16 CurrentScanMode ;
        uint32 CurrentVerticalResolution ;
        string Description ;
        string DeviceID ;
        uint32 DeviceSpecificPens ;
        uint32 DitherType ;
        datetime DriverDate ;
        string DriverVersion ;
        boolean ErrorCleared ;
        string ErrorDescription ;
        uint32 ICMIntent ;
        uint32 ICMMethod ;
        string InfFilename ;
        string InfSection ;
        datetime InstallDate ;
        string InstalledDisplayDrivers ;
        uint32 LastErrorCode ;
        uint32 MaxMemorySupported ;
        uint32 MaxNumberControlled ;
        uint32 MaxRefreshRate ;
        uint32 MinRefreshRate ;
        boolean Monochrome ;
        string Name ;
        uint16 NumberOfColorPlanes ;
        uint32 NumberOfVideoPages ;
        string PNPDeviceID ;
        uint16 PowerManagementCapabilities[] ;
        boolean PowerManagementSupported ;
        uint16 ProtocolSupported ;
        uint32 ReservedSystemPaletteEntries ;
        uint32 SpecificationVersion ;
        string Status ;
        uint16 StatusInfo ;
        string SystemCreationClassName ;
        string SystemName ;
        uint32 SystemPaletteEntries ;
        datetime TimeOfLastReset ;
        uint16 VideoArchitecture ;
        uint16 VideoMemoryType ;
        uint16 VideoMode ;
        string VideoModeDescription ;
        string VideoProcessor ;
        };

        Hope this helps, Bill

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hi Bill, I'm trying to get started with WMI, but I'm stuck. How do I start? Have you tried it or can you maybe point me to a working code sample somewhere? /T

        B 1 Reply Last reply
        0
        • L Lost User

          Hi Bill, I'm trying to get started with WMI, but I'm stuck. How do I start? Have you tried it or can you maybe point me to a working code sample somewhere? /T

          B Offline
          B Offline
          Bill Wilson
          wrote on last edited by
          #4

          http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?url=/msdn-files/027/001/566/msdncompositedoc.xml Download the WMI sdk, its full of samples. You will need to do some reasearch on your own and learn about WMI and how it works. Try using the search engine on this site, codeguru and others. Learning to research a problem will server you well in the future. Thanks for the help, Bill

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups