View unanswered posts | View active topics It is currently September 3rd, 2014, 4:35 am



Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
 Get name of your display adapter / graphics card 
Author Message

Developer

User avatar

Joined: April 19th, 2009, 11:02 pm
Posts: 10876
Location: Fairfax, VA
Post Get name of your display adapter / graphics card
June 2nd, 2011, 10:40 pm
It is extremely complicated bordering on impossible to get the name of your graphics card / display adapter from the Windows registry. This information is actually retrieved by Windows and applications using a Windows API call that queries the display driver, rather than just being stored as plain text. So I thought I would knock out a little addon to retrieve that information for use in a skin if you need it.

Get and install this skin. The addon will also be installed in the Rainmeter\Addons folder.

Attachment:
GetAdapter.rmskin [363.56 KiB]
Downloaded 654 times


The skin is just a little example to show how to use the addon.

Here is the skin code so I can explain a couple of things:

[Rainmeter]
Update=1000
DynamicWindowSize=1
OnRefreshAction=!Execute ["#ADDONSPATH#DisplayAdapter\DisplayAdapter.exe" "#CURRENTPATH#DisplayAdapter.txt"][!RainmeterEnableMeasure MeasureGetAdapter "#CURRENTCONFIG#"]

[MeasureGetAdapter]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=file://#CURRENTPATH#DisplayAdapter.txt
RegExp="(?siU)<DisplayAdapter>(.*)</DisplayAdapter>"
StringIndex=1
FinishAction=!Execute [!RainmeterDisableMeasure MeasureGetAdapter "#CURRENTCONFIG#"]
Disabled=1

[MeterDisplay]
Meter=String
MeasureName=MeasureGetAdapter
FontSize=10
FontColor=255,255,255,255
StringStyle=Bold


So what happens is that when the skin is loaded or refreshed, the addon is run and creates a little text file with the information in the designated location and file. It then "enables" a WebParser measure to read the file and display it with a string meter.

The reason I do it this way, with the WebParser measure disabled, is for two reasons. First, there is no need to EVER execute this addon on any "timed" basis. You obviously can't change your video card while Rainmeter is running. No matter how big you make UpdateRate on the measure, it's technically always a waste of resources. Second, due to the nature of Rainmeter, when you first run the skin brand new there will not yet be the text file created by the addon, so nothing will be returned on the first pass. Using the OnRefreshAction with the "!RainmeterEnableMeasure" gives the addon time to create the file before the WebParser measure is run.


Last edited by jsmorley on July 16th, 2011, 8:50 pm, edited 1 time in total.

Edited and attachment updated to add quotes to #CURRENTCONFIG#


Profile

Developer

User avatar

Joined: April 19th, 2009, 11:02 pm
Posts: 10876
Location: Fairfax, VA
Post Re: Get name of your display adapter / graphics card
June 2nd, 2011, 11:05 pm
Modified to work better with UAC and not cause security prompts.

Profile

Joined: June 9th, 2011, 3:39 pm
Posts: 11
Post Re: Get name of your display adapter / graphics card
June 12th, 2011, 3:47 am
Hmm...I'm a total n00b here, but I wanted to try this tool out, and ran into some issues right off the bat.

I downloaded it, and it ran an installer. I ran the installer and hit "refresh all" on the task bar, and a skin I was working on got modified. Specifically, I had an image file that I was using as a foreground on my project, and now it now longer displays.

Any ideas?

(Also, there was a "Rainbackup" and a "Rain Browser" in my programs list that I hadn't seen before and couldn't uninstall - were this installed with this project, or are they default features that I didn't know about?)

Profile

Joined: June 9th, 2011, 3:39 pm
Posts: 11
Post Re: Get name of your display adapter / graphics card
June 12th, 2011, 4:13 am
Never mind. I'm an idiot. Some how, upon a refresh, it had just switched to an older version of my skin I didn't realize I still had installed.

Profile

Developer

User avatar

Joined: April 19th, 2009, 11:02 pm
Posts: 10876
Location: Fairfax, VA
Post Re: Get name of your display adapter / graphics card
June 12th, 2011, 6:06 am
(Also, there was a "Rainbackup" and a "Rain Browser" in my programs list that I hadn't seen before and couldn't uninstall - were this installed with this project, or are they default features that I didn't know about?)

Those are addons that come with Rainmeter when you install it. http://rainmeter.net/cms/Rainmeter101

Profile
User avatar

Joined: June 9th, 2010, 5:56 pm
Posts: 1194
Location: Locks heath, UK
Post Re: Get name of your display adapter / graphics card
July 16th, 2011, 6:22 pm
This works perfectly in another skin and it's functional on my desktop.

A straight cut & paste from the old skin to the new one, refresh skin, sees Display adapter.txt appear in the correct folder with the right details.

However, Rainmeter "About" shows nothing on the new skin for MeasureGetAdaptor, but the right info on the old skin.

Is this plugin something that can only be run once from one skin in one Windows session? Failing that I'll reboot writes a test skin using the above example and see it plays nice... :lol:

Profile WWW

Developer

User avatar

Joined: April 19th, 2009, 11:02 pm
Posts: 10876
Location: Fairfax, VA
Post Re: Get name of your display adapter / graphics card
July 16th, 2011, 6:30 pm
Seahorse wrote:
This works perfectly in another skin and it's functional on my desktop.

A straight cut & paste from the old skin to the new one, refresh skin, sees Display adapter.txt appear in the correct folder with the right details.

However, Rainmeter "About" shows nothing on the new skin for MeasureGetAdaptor, but the right info on the old skin.

Is this plugin something that can only be run once from one skin in one Windows session? Failing that I'll reboot writes a test skin using the above example and see it plays nice... :lol:


You know you have a typo somewhere... :-)

You certainly can have more than one skin using it at a time. That is not an issue.

Attachment:


Profile
User avatar

Joined: June 9th, 2010, 5:56 pm
Posts: 1194
Location: Locks heath, UK
Post Re: Get name of your display adapter / graphics card
July 16th, 2011, 7:49 pm
I assumed typo so cut & pasted from source into the skin with the same result, so I moved onto a test skin using teh code from the OP and still get nothing.
Attachment:
Capture1.PNG
Capture1.PNG [ 11.48 KiB | Viewed 5106 times ]

However the skin it was originally used in, Skeleton, works fine.
Attachment:



What I find really confusing is it is clearly working as far as the create DisplayAdapter.txt part:
Attachment:
Capture3.PNG
Capture3.PNG [ 11.71 KiB | Viewed 5106 times ]

which makes it look like the RegExp is failing, but given that identical code works here and for two instances at your end that doesn't make sense either.

Profile WWW

Developer

User avatar

Joined: April 19th, 2009, 11:02 pm
Posts: 10876
Location: Fairfax, VA
Post Re: Get name of your display adapter / graphics card
July 16th, 2011, 7:54 pm
I think you are going to find you are missing some quotes somewhere, since your new config has a space in the name.

Profile

Developer

User avatar

Joined: April 19th, 2009, 11:02 pm
Posts: 10876
Location: Fairfax, VA
Post Re: Get name of your display adapter / graphics card
July 16th, 2011, 7:57 pm
Probably in the URL setting on the WebParser measure.

Profile
Display posts from previous:  Sort by  
Reply to topic   [ 19 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.