Desktop Hz

BlitzMax Forums/BlitzMax Programming/Desktop Hz

Shagwana(Posted 2006) [#1]
Anyone got a simple function to get the Hertz of the desktop?. And also i guess the depth of the desktop too :)


Yan(Posted 2006) [#2]
http:/Community/posts.php?topic=59969#668747


Grey Alien(Posted 2006) [#3]
do this BEFORE you call graphics:

GetDeviceCaps(GetDC(0),VREFRESH)
it returns the Hz.


ImaginaryHuman(Posted 2006) [#4]
The only thing to keep in mind is that some systems report the hertz of the desktop as 0, even using these o/s calls, and also with the Desktop Extension module found in that forum linked up there. Under those conditions you still cannot tell what the hertz of the desktop really is.


BlitzSupport(Posted 2006) [#5]
Yep, the VREFRESH flag only applies to NT systems:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_88s3.asp

I've never found any reliable way to get this from Windows 9x, even digging through the Registry for what Desktop Properties shows. I think it might be a driver-specific setting on 9x, ie. different for different cards. Could be wrong, though...


Grey Alien(Posted 2006) [#6]
yes that's true, forgot to mention it. It returns 0 on win98.