actual refreshrate and colordepht

How could I get the actual refreshrate and the colordepht of the current graphicmode? I need to store these values to a txt-File.
should work with NT and Win9x

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

var MyDevMode:Tdevmode;
    WriteLn(outfile,'Refresh :'+inttostr(freq));
    WriteLn(outFile,'Color depth (bits) :'+inttostr(colorRes));

Good luck!!
redforceAuthor Commented:
thanks for your reply. But under WinNT (Using Elsa Synergy Graphicadapter) this code doesn't sent the right refreshrate. In the resultfile it has the value 1.
Colordepht works fine.
is there an other way than dmDisplayFrequency?
redforceAuthor Commented:
Adjusted points to 100
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Sorry, I think, it depends on the graphics driver, whether you can get the refresh rate or not. I didn't come across a graphics driver yet, that DID tell us the refresh rate correctly. Sad, but true...   :-(
Of course I could be wrong with this...   :-)

Regards, Madshi.
Funny, here at home it DOES NOT give it to me either (Win 98), but at work, (Win(98 as well) it DOES. Hmmmm.... I'll have to investigate this a little more, I think. Wonder what my laptop will do? :)
If you want the correct refresh rate all the time, you cannot depend on the Win32 API, since how it works depends on a lot of factors: OS, drivers, service packs, etc.

I wrote a code that will go measure the refresh rate. I cannot post the code here because it is commercial software, but you can download a component also written by me that will give you the refresh rate: TASSysInfo.

You can download it from :

Athena's Place:

Go to the AS PowerTools page (if Delphi 3) or the AS OmniTools page (if Delphi 4.03).

The component gives you the correct refresh rate in all Win9x and WinNT.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
redforceAuthor Commented:
Hi Alex, tried your componet on several computers! Works really fine. But only at my one it dosn't send the right values. No value under WinNT or under Win95 what's wrong? I use ElsaSynergy 8MB with newest drivers on a Gygabyte 6BXD Motherboard. At a computer with ElsaWinner 2000AVI-2MB your component works fine.
Any Idea?


Do you have this component for Delphi5?
redforceAuthor Commented:
oh, I forget to say that my graphicsadapter is PCI on a Motherboard with AGP Slot. Perhaps that's the problem.
In that case I suspect it's the card that isn't reporting the values correctly.

I've tried it with the following cards:

Trident 9440, PCI (NT and 98)
Diamond Stealth 3200, PCI (NT and 95)
Matrox Millenium, PCI (98)
Diamond Speedstar Plus, ISA(NT and 95)
Realtek (no model info), ISA (95)
Creative Labs 3D Blaster (95 and 98)
Creative Labs Blaster 3D (95 and 98)
ATI (no model info) PCI, (95, 98, NT)
.... and a few others I can't remember

These are the tests I've performed myself. Besides that there are a lot of users who have been using it for a long time.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.