Tool

bkeadle's picture
tool
Reads:

11387

Score:
2
2
1
 
Comments:

0

GetScreenRes 1.0

Author Info

12 October 2007 - 10:29am
Submitted by: bkeadle

(View Disclaimer)

license: 
Free

By Bryan Keadle

GetScreenRes is a simple utility that will create registry keys and temporary files to indicate a person's current screen resolution. What's the point? Perhaps you have some scripting you'd like to do and need to know, programmatically, what the user's current screen resolution is; or perhaps you want to have a conditional application object based on the user's screen resolution.

For example, I have a couple application objects to allow users to set their screen resolution to a few pre-defined standard sizes - so they can have a choice of screen resolutions, but without giving them access to Windows' Display settings (and potentially selecting an unsupported resolution). I wanted a way to show the application objects of the resolution choices that *didn't* include their existing resolution. This graphic shows the available screen resolutions, excluding the 1024x768 option because that's the resolution currently set:

Also, for another project, I wanted to know what size of a particular watermark graphic to copy to their local workstation that matches their current screen resolution.

GetScreenRes makes this screen resolution information easily accessible. It creates the following registry keys (using 1024x768 resolution as an example):

[HKEY_LOCAL_MACHINE\SOFTWARE\KeadleWorks]
"ScreenResolutionX"="1024"
"ScreenResolutionY"="768"

And creates the following files:

%TEMP%\ScreenRes\1024x768
%TEMP%\ScreenRes.txt

both files containing the text:

1024x768

So you have 3 different ways to read this screen information, whatever works best for you for certain situations.

As for my NAL object example above, I simply ForceRun GetScreenRes to run upon login, and my Screen Resolution objects are dependent on the registry key value to *NOT* equal the resolution it is set for:

ZałącznikWielkość
GetScreenRes.zip510.53 KB

Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell