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

Thanks.
redforceAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
simonetConnect With a Mentor Commented:
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: http://www.bhnet.com.br/~simonet

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.

Yours,

Alex
0
 
DrDelphiCommented:
var MyDevMode:Tdevmode;
    outfile:Textfile;
    freq,colorres:integer;
begin
    assignfile(outfile,'Z:\mysettings.txt');
    rewrite(outfile);
    myDevmode.dmsize:=sizeof(mydevmode);
    enumdisplaysettings(nil,0,mydevmode);
    freq:=mydevmode.dmDisplayFrequency;
    ColorRes:=mydevmode.dmBitsPerPel;
    WriteLn(outfile,'Refresh :'+inttostr(freq));
    WriteLn(outFile,'Color depth (bits) :'+inttostr(colorRes));
    closefile(outfile);
end;




Good luck!!
0
 
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?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
redforceAuthor Commented:
Adjusted points to 100
0
 
MadshiCommented:
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.
0
 
DrDelphiCommented:
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? :)
0
 
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?

Jan

Do you have this component for Delphi5?
0
 
redforceAuthor Commented:
oh, I forget to say that my graphicsadapter is PCI on a Motherboard with AGP Slot. Perhaps that's the problem.
Jan
0
 
simonetCommented:
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.

Yours,

Alex
0
All Courses

From novice to tech pro — start learning today.