hey i have to make a program using win32 c++ and i need to get my hands on some information from the registry which i cannot find.
the problem is i need to find information about the graphic card the pc is using and this software has 2 be ported to different pcs so it can not be specified, hope you guys get what i mean and any help is much apperciated

Dani AI

Generated

Garbled names in Regedit are common for display adapters. The key pointed to often contains non‑plain strings: either binary blobs, Unicode stored in a different encoding, or resource references (strings that point into the driver INF/resource table rather than containing the human name). That explains why Regedit shows odd characters instead of a readable device name. As hinted, using an API that enumerates adapters avoids those pitfalls.

A practical, portable approach in Win32 C++:

  • Use the display‑enumeration API to get user‑visible adapter strings quickly.
  • If you need canonical device/vendor/PCI IDs or to resolve resource references reliably, use the SetupAPI/Configuration Manager APIs.
  • For quick scripts or system queries, WMI’s Win32_VideoController class is another option.

Minimal EnumDisplayDevices example (Win32):

#include <windows.h>
#include <iostream>

int main()
{
    DISPLAY_DEVICE dd;
    ZeroMemory(&dd, sizeof(dd));
    dd.cb = sizeof(dd);

    for (DWORD i = 0; EnumDisplayDevices(NULL, i, &dd, 0); ++i)
    {
        std::wcout << L"Adapter " << i << L": " << dd.DeviceString << L"\n";
        ZeroMemory(&dd, sizeof(dd));
        dd.cb = sizeof(dd);
    }
    return 0;
}

If registry values begin with a resource reference (for example, an INF token), resolve them with SetupDi APIs rather than reading the raw registry. To detect why a value looks wrong, call RegQueryValueEx and check the type (REG_SZ, REG_EXPAND_SZ, REG_BINARY, etc.). References: EnumDisplayDevices docs , , Win32_VideoController (WMI).

Summary checklist: try EnumDisplayDevices first for friendly names; use SetupAPI/CM to get driver/resource‑resolved descriptions and hardware IDs; use WMI for higher‑level queries. This avoids brittle parsing of raw registry data.

Recommended Answers

All 3 Replies

use Regedit program and look in HKEY_LOCAL_MACHINE\\Hardware\\Devicemap\\Video
That's where its at on Vista.

hey i did look there but for some reason when i follow the path i cant seem to get the actual device description i just get some weird chars instead of the actual device name any ideas y??

Is there a specific reason you need this from the registry? Graphics packages include this ability, as well as the ability to enumerate the different cards on a machine if there are multiple. It's much more specific info. DirectX does it, I believe that GDI+ has it, OpenGl, etc...

Thanx...
Sean

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.