Page 1 of 1 1
Topic Options
#7740 - 2001-03-28 12:14 AM Scanning 95 and Nt registry to find out the Display Resolution
Anonymous
Unregistered


Does anyome know the key you need ro read to find out what resolution the pc is running in?
I require this to enable standardised Wallpaper on our domian.

Top
#7741 - 2001-03-27 02:27 PM Re: Scanning 95 and Nt registry to find out the Display Resolution
Anonymous
Unregistered


I just a had a quick look on my Win98 machine and found the relevant entry at HKEY_LOCAL_MACHINE\Config\0001\Display\Settings\Resolution.

Top
#7742 - 2001-03-27 07:28 PM Re: Scanning 95 and Nt registry to find out the Display Resolution
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
here you go...

code:

$videokey="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\"
$VidCard= enumkey("$videokey",$index)
if @error=0
$video=$videokey+$VidCard+"\Device0"
$xres=readvalue("$video","DefaultSettings.XResolution")
$yres=readvalue("$video","DefaultSettings.YResolution")
else
$xres=640
$yres=480
endif


_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#7743 - 2001-03-28 03:05 AM Re: Scanning 95 and Nt registry to find out the Display Resolution
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Only partially related, but someone might find it useful.

Only works on NT...

This uses SendKeys to get the screen properties of the current DOS box by ALT+SPACing to the Properties page and COPY and PASTing the Width and Height into the DOS box window. The PASTE goes into the keyboard buffer and is retrieved by the GETS function.


getScreenInfo.KiX

code:

break on
cls


; get dos box width and height
"Width="
$=sendkeys("~ p^{ins}{esc}{esc}~ ep{enter}")
gets $width


"Height="
$=sendkeys("~ p{tab}^{ins}{esc}{esc}~ ep{enter}")
gets $height


quit



cj

Top
#7744 - 2001-03-29 03:36 AM Re: Scanning 95 and Nt registry to find out the Display Resolution
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Information about your monitor you can get with following code.

code:

$ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\Monitor\0000"
IF (Exist($ikey) <> 1)
? "monitor = "+ReadValue($ikey,"DriverDesc")
? "monitor.resolution (max) = "+ReadValue($ikey,"MaxResolution")
ENDIF
$ikey="HKEY_LOCAL_MACHINE\Config\0001\Display\Settings"
IF (Exist($ikey) <> 1)
? "monitor.resolution (current) = "+ReadValue($ikey,"Resolution")
ENDIF

Example of run:

code:

monitor = Philips 107A
monitor.resolution (max) = 1600,1200
monitor.resolution (current) = 1024,768

Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 735 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.05 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org