Novell Cool Solutions

Displaying Apps only if Screen Size is Right



By:

November 10, 2007 11:00 pm

Reads:4,661

Comments:0

Score:5

Print/PDF

By Chris Graham

PROBLEM: We have a NAL application that we only want to be available if the screen resolution is 1024×768 or higher. We have had no luck finding anything in the registry, in a readable format, to determine the screen size.

Solution

Create a forced-run, install-only NAL app. Place the code in the Run Options|Launch Scripts|Run before Launching box. Set the Script Engine Location to wscript.exe and the file extension to .vbs

The code will determine the screen resolution, create an environment variable (ScrRes) with the value of the width of the screen and refresh NAL.

We then use the ScrRes variable to determine the availability of our other application.

Example

set oShell = wscript.createobject("wscript.shell")
set sysenv = oshell.environment("Volatile")

'*** Get width value of screen resolution
with createobject("internetexplorer.application")
    .navigate "about:blank"

'*** Set the ScrRes environment variable to equal the screen width
    with .document.parentWindow.screen
       sysenv("ScrRes") = .width
    end with
end with

'*** Wait 5 seconds and refresh NAL
wscript.sleep 5000

oShell.run "Z:\mgmt\ConsoleOne\1.2\lib\zen\autorun.exe"

If you have any questions you may contact Chris at grahamcTAKETHISOUT@tbh.net

1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5 (1 votes, average: 5.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...

Categories: Uncategorized

0

Disclaimer: This content is not supported by Novell. 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 it thoroughly before using it in a production environment.

Comment

RSS