Link to home
Start Free TrialLog in
Avatar of redforce
redforce

asked on

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.
Avatar of DrDelphi
DrDelphi

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!!
Avatar of redforce

ASKER

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?
Adjusted points to 100
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? :)
ASKER CERTIFIED SOLUTION
Avatar of simonet
simonet
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?
oh, I forget to say that my graphicsadapter is PCI on a Motherboard with AGP Slot. Perhaps that's the problem.
Jan
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