Solved

how to get VideoCard information using DeviceIoControl

Posted on 2003-11-08
5
964 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

695 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