Jump to content


Photo

Simple Video Card Dll


  • Please log in to reply
16 replies to this topic

#1 tangibleLime

tangibleLime

    Lunatic

  • GMC Elder
  • 2520 posts
  • Version:GM:HTML5

Posted 18 January 2007 - 02:20 AM

Video Card DLL

This is a very simple DLL to return three things about the video card:
- Driver
- Memory
- DLL

All of the video memory and other video card informations are located in the Windows registry. Unfortunately, pre-NT Windows versions have the information in a different location. I'll go over how to get both, and at the end, I'll post the DLL. If you want to learn something, read on. If you really don't give a hoot, just download the DLL.

Like I said before the video card informations are located in the registry, but not in a given location. That's the tricky part. First, we need to find the registry key for the video card. To do that, we go to the HARDWARE\DEVICEMAP\VIDEO in HKEY_LOCAL_MACHINE. We then search for the key labeled \Device\Video0. In this key, you will find the location of the video card information, but it's not so straightforward.

The text in this key should look something like this:
(The numbers/text in the brackets may differ)

\Registry\Machine\System\CurrentControlSet\Control\Video\{49079038-BBEF-4CCF-82B6-2AD40FC3B838}\0000

To use this, we need to cut off the "\Registry\Machine" part. After we do that, we have the location of the video card information.

If you're manually viewing this in regedit, you will now see a list of keys in the 0000 subkey. To find the video memory, we need to search for this key: HardwareInformation.MemorySize. Unfortunately, the type of this key is is REG_BINARY, which Game Maker can't return with it's own functions, which is why I'll write you a small DLL. If I missed something huge and didn't realize Game Maker could return such values, please correct me.

Anyways, when you get the data from HardwareInformation.MemorySize it's not going to be in MB form, it will be in bytes. To put it in MB form, simply divide it by 1024 twice. If you want it in KB form, divide it by 1024 once.

Now, getting this information in a pre-NT environment is relatively easier. We do not need to hunt for the information, because it's in a nice convenient location. Locate to this key: System\CurrentControlSet\Services\Class\Display\0000\INFO, and this subkey: VideoMemory.

Retrieving the other information in this DLL is the same as getting the memory. They are just located in different keys.

This DLL was quickly made in response to this topic:
http://forums.gamema...howtopic=269992

DLL Download:
VideoCardDLL.zip (~5 KB)

Rock on,
Roach
  • 1
Posted ImagePosted Image

#2 DFortun81

DFortun81

    The Fortunate One

  • GMC Member
  • 899 posts
  • Version:GM:Studio

Posted 18 January 2007 - 03:07 AM

Unfortunately, the type of this key is is REG_BINARY, which Game Maker can't return with it's own functions, which is why I'll write you a small DLL. If I missed something huge and didn't realize Game Maker could return such values, please correct me.

GM uses REG_BINARY for real values, I'm not sure, but I think it can be done. I'll test it out and see what happens.

I'll edit this post when done,
-DF81
EDIT: I can't seem to get it to work, I think that GM may restrict access to the SYSTEM subfolder, but I'll keep trying.

EDIT2: Yup, just as I expected. GM restricts access to the System information. Here's a GM6 file showing what I did and why it's not working: Link. In the help file, GM states that if the function returns 0, that means the Key, name combination doesn't exist. BUT, when using registry_exists_ext(key,name), it returns that the combo does in fact exist, although the read functions act as though it doesn't.

But now we have your DLL and don't have to worry about GM's built-in security detection.

Good Job.

Edited by DFortun81, 18 January 2007 - 04:00 AM.

  • 0

dia_rpg_builder.png
Navigate to my personal website by clicking the image above.


#3 Pogo708

Pogo708

    GMC Member

  • New Member
  • 107 posts

Posted 18 January 2007 - 05:40 AM

Sweet, thanks a ton! I really appreciate you writing this for me!
  • 0

#4 OpticalLiam

OpticalLiam

    GMC Member

  • New Member
  • 782 posts

Posted 18 January 2007 - 11:29 AM

This is great, it will allow for developers to create recommended game settings for a given computer. I'm sure GG is going to be happy.

Can I ask, how reliable is it? Will it pick up all graphics cards?

Cheers, this is really cool.
  • 0

#5 tangibleLime

tangibleLime

    Lunatic

  • GMC Elder
  • 2520 posts
  • Version:GM:HTML5

Posted 21 January 2007 - 02:58 AM

Can I ask, how reliable is it? Will it pick up all graphics cards?

<{POST_SNAPBACK}>

Do you mean will it pick up every type of graphics card? As in manufacturer? It should. Or do you mean will it pick up every graphics card installed on the computer? In that case, no. This DLL will only return the primary card.

Edited by Roach, 21 January 2007 - 02:59 AM.

  • 0
Posted ImagePosted Image

#6 allan124

allan124

    GMC Member

  • New Member
  • 4 posts

Posted 11 August 2008 - 12:28 AM

could you pls send the dll and gmk file to allan_stonerocker89@hotmail.com. Urgent.
Plus is there a way to display the actual graphics card type?

Edited by allan124, 11 August 2008 - 12:34 AM.

  • 0

#7 Creator527

Creator527

    GMC Member

  • New Member
  • 7 posts

Posted 23 September 2008 - 10:23 PM

-deleted-

Edited by Creator527, 20 December 2009 - 05:20 PM.

  • 0

#8 death-droid

death-droid

    GMC Member

  • GMC Member
  • 2600 posts

Posted 24 September 2008 - 10:13 AM

Read his signature then you would figure out why and do what it says.
  • 0

Posted Image


#9 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 24 September 2008 - 12:03 PM

The DLL was actually removed, I will attempt to get it. This is what the link should have been.

http://wowthatsaweso...ideoCardDLL.zip

Couldn't find it :mellow:

Edited by GMREC1111, 24 September 2008 - 12:04 PM.

  • 0

#10 death-droid

death-droid

    GMC Member

  • GMC Member
  • 2600 posts

Posted 25 September 2008 - 11:01 AM

Do you want it gmrec1111 i can upload if for you if you want. :)
I happen to still have it lol.
  • 0

Posted Image


#11 SerMSYS

SerMSYS

    GMC Member

  • New Member
  • 180 posts

Posted 29 September 2008 - 12:59 AM

I actually found use for this DLL, so an upload would be appreciated :)
  • 0
Battlefield 2/CoD 4/Fallout 3/GTA IV player | Quad-Core owner

#12 death-droid

death-droid

    GMC Member

  • GMC Member
  • 2600 posts

Posted 29 September 2008 - 07:17 AM

The only problem is i dont have the scripts or example any more :)
But i do have a gex that has all the functions in it.
  • 0

Posted Image


#13 dj_rive

dj_rive

    GMC Member

  • New Member
  • 7 posts

Posted 30 April 2009 - 12:18 AM

The download link is broken
  • 0

#14 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 03 May 2009 - 01:10 AM

The dll doesn't work on Vista anyway.
  • 0
GM 8.1 / GM:HTML5 User

#15 Artaex Media

Artaex Media

    Artaex Media

  • GMC Member
  • 1531 posts
  • Version:Unknown

Posted 29 September 2010 - 08:17 PM

Download VideoCard.dll (Found the dll in one of my oldest games xD)

I don't have any example or script! But here's some information:

videocard_memory's external call = "funct_memory" (0 args, result = real, stdcall)
videocard_driver's external call = "funct_driver" (0 args, result = string, stdcall)
videocard_dll's external call = "funct_thedll" (0 args, result = string, stdcall)

Edited by Reflux Entertainment, 29 September 2010 - 08:22 PM.

  • 1

#16 jon sploder

jon sploder

    GMC Member

  • GMC Member
  • 919 posts

Posted 22 December 2010 - 11:06 PM

Scripts

videocard_init
var dll;
dll="VideoCard.dll"; //Will get it from anywhere, if you've misplaced it from the working directory.
global.vcdll_driver=external_define(dll,"funct_driver",1,1,0);
global.vcdll_memory=external_define(dll,"funct_memory",1,0,0);
global.vcdll_thedll=external_define(dll,"funct_thedll",1,1,0);
videocard_memory
//Returns the bytes of video memory. So to get something more practical to work with (MB), divide by 1 048 576.
external_call(global.vcdll_memory);
videocard_driver
//Returns a string of the video card driver
external_call(global.vcdll_driver);
videocard_thedll
//Returns a string of the video card dll
external_call(global.vcdll_thedll);

:)

Edited by jon sploder, 22 December 2010 - 11:07 PM.

  • 0

#17 Kielek1248

Kielek1248

    GMC Member

  • New Member
  • 4 posts
  • Version:GM8

Posted 20 December 2015 - 12:15 AM

Please fix the link! I need that dll!


  • 0