Solved

how to get VideoCard information using DeviceIoControl

Posted on 2003-11-08
5
940 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now