English
Source / code snippets

Bildschirmauflösung Change / Vollbild / Fullscreen 2021

 

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
 
09/15/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.499 Views

Untitledvor 0 min.
Sven Bader02/01/23
Ernst05/29/22
Thomas Freier02/18/22
p.specht11/18/21
More...

Themeninformationen

this Topic has 1 subscriber:

Sven Bader (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie