| |
|
|
Sven Bader | from irgendeinem reason funktionierte the Change the Bildschirmauflösung in my middle-aged play not any more, sowohl with the Windows API as well as with the prospeed.dll not. The herangehensweise is usually, The Bildschirmeinstellungen by EnumDisplaySettings To fetch and the area only The values for Bildschirmauflösung anzupassen and everything else unberührt To let.
to that Debuggen have I EnumDisplaySettings carryed out during one other game The dissolution correctly changed has. so coming I hereon, that my Monitor The 60Hz Bildwiederholrate, which with 1920x1200 standard are with 640x480 not supported.
my code is neither perfect, it testing solely familiar Bildwiederholraten and dial with one Auflösungswechsel The supreme. "Exotische" Bildwiederholraten go means not berücksichtigt.
One Another Error, the often begangen becomes, is the Fullscreen Flag &CDS_FULLSCREEN To forget. These says from, that The dissolution not lasting for Desktop-employment separate solely for duration the Programmausführung changed go should. so becomes with one Programmabsturz or unsauberen terminate The ursprüngliche dissolution the system restored. I mean, that too one effect on stranger Window (verkleinern) and the move of Desktop Icons so prevented becomes.
DEF EnumDisplaySettings(3) !"USER32","EnumDisplaySettingsA"
DEF ChangeDisplaySettings(2) !"USER32","ChangeDisplaySettingsA"
Declare devmode#,devmodeoriginal#,fehl&
Dim devmode#,148
Dim devmodeoriginal#, 148
Proc ChangeRes2021
Parameters x&, y&
declare hz&[8]
hz&[1] = 360
hz&[2] = 240
hz&[3] = 144
hz&[4] = 120
hz&[5] = 75
hz&[6] = 60
hz&[7] = 59
Def &CDS_UPDATEREGISTRY $00000001
Def &CDS_TEST $00000002
Def &CDS_FULLSCREEN $00000004
Def &CDS_GLOBAL $00000008
Def &CDS_SET_PRIMARY $00000010
Def &CDS_RESET $40000000
Def &CDS_SETRECT $20000000
Def &CDS_NORESET $10000000
if ((x& = 0) | (y& = 0))
ChangeDisplaySettings(devmodeoriginal#,0)
else
EnumDisplaySettings(0, -1 ,devmode#)
long devmode#,104=%BitsPixel
long devmode#,108=x&
long devmode#,112=y&
fehl& = -2
whileloop 7
long devmode#,120 = hz&[&loop]
fehl& = ChangeDisplaySettings(devmode#,&CDS_TEST)
if (fehl& = 0)
'messagebox Str$(hz&[&loop])+ "Hz is the highest working refresh rate","",0
fehl& = ChangeDisplaySettings(devmode#,&CDS_FULLSCREEN)
break
endif
endwhile
endif
Endproc
cls
ChangeRes2021(1024,768)
settimer 10000'to 10 sec restore
waitinput
killtimer
end
|
|
|
| |
|
|