Solved

how to get VideoCard information using DeviceIoControl

Posted on 2003-11-08
5
949 Views
Last Modified: 2007-12-19
how can i get videocard information (Model, Chipset, VideoMemory ammount, supported display modes) using DeviceIoControl();

here is some code that i have. i think it's wrong. what should i do?

sprintf(DeviceName, "\\\\.\\DISPLAY1");
hDevice = CreateFile(DeviceName, GENERIC_READ,
                               FILE_SHARE_READ,
                            NULL, OPEN_EXISTING,
                               FILE_ATTRIBUTE_NORMAL, NULL);
if(hDevice != NULL)
{
   DeviceIoControl(hDevice, 0,
                          &InBuffer, InBufferSize,
                          &OutBuffer, OutBufferSize,
                          &BytesReturned, NULL);
   .....
}
CloseHandle(hDevice);
0
Comment
Question by:Crackman
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:George Tokas
ID: 9714969
Supposed that you are using windows and all are setted up correctly you can get those info AND from registry and from DirectX.
Registry have all the info you want about display modes chipset and model.
The memory ammound can be retrieved through DirectX functions.

gtokas.
0
 

Author Comment

by:Crackman
ID: 9716295
i know about directX functions of getting memory ammount, but i wanted to do it without directX.
BTW Is there any way to get AGP info from registry.
Actully i need as much information as i can get without DirectX.
Can you explain where exactly in registry this information is.
0
 
LVL 16

Accepted Solution

by:
George Tokas earned 150 total points
ID: 9716737
As I saw in one of my machines (winME) the info is at PCI at registry.
the info you need is at HKEY_LOCAL_MACHINE\System\currentcontrolset\services\class\DISPLAY
As 4 DirectX anyway it is installed on windows machines with version >3 so without any problem you can use those functions.

gtokas.
0
 

Author Comment

by:Crackman
ID: 9725170
registry sucks
i'll use dirextx. i wasn't sure about it but now i think it will work fine.
0
 
LVL 16

Expert Comment

by:George Tokas
ID: 9730505
It will but you will not get info about chipset and model...
Anyway there is a way to find those without using the registry using the VGA registers but it is not that easy...

Regards,
gtokas
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question