| Von me - z.B. para Spielehersteller: KompilierenMarcaSeparación//Erst ab XProfan 9!
//Mit Res 1024 auf 1024x768 setzen, Zurücksetzen einfach mit res 0.
//Frequenz, Bitspixel etc. bleiben erhalten.
//Res kennt nur einen Parameter.
declare __res_devmode#,__res_odevmode#
dim __res_devmode#,148
dim __res_odevmode#,148
clear __res_devmode#
clear __res_odevmode#
Proc res
Parameters x%
declare y%
if (x%==0)
external("user32","ChangeDisplaySettingsA",__res_odevmode#,0)
else
y%=mul(3,div(X%,4))
ifnot long(__res_devmode#,0)
external("user32","EnumDisplaySettingsA",0,-1,__res_devmode#)
__res_odevmode#:=__res_devmode#
endif
long __res_devmode#,108=x%
long __res_devmode#,112=y%
external("user32","ChangeDisplaySettingsA",__res_devmode#,0)
endif
endproc
proc res.close
dispose __res_devmode#
dispose __res_odevmode#
ENDPROC
Bildschirmauflösungen auflisten, Auflösung ändern de Andreas Miethe: KompilierenMarcaSeparación $H windows.ph
$H structs.ph
$H messages.ph
$H commctrl.ph
$H shellapi.ph
Declarar BBPSettings$,HSettings$,WSettings$,X&
Declarar Dev#,Static&,CB&,Dummy$,OK&,Change&,Ende&,GC&,F$
Proc GetCurrentSettings
Declarar RetString$,c$,whx$,why$,co$
c$ = Str$(~GetDeviceCaps(~GetDC(0),~BITSPIXEL))
whx$ = Str$(~GetDeviceCaps(~GetDC(0),~HORZRES))
why$ = Str$(~GetDeviceCaps(~GetDC(0),~VERTRES))
If c$ = "4"
co$ = "16 Farben"
ElseIf c$ = "8"
co$ = "256 Farben"
ElseIf c$ = "16"
co$ = "HightColor"
ElseIf c$ = "32"
co$ = "TrueColor"
EndIf
Retstring$ = whx$ + " * " + why$ + " - " + co$
Volver Retstring$
ENDPROC
Proc EnumDisplay
Declarar F$,DD$
Mientras que ~EnumDisplaySettings(0,X&,Dev#)
If Largo(Dev#,104) = 4
F$ = "16 Farben"
ElseIf Largo(Dev#,104) = 8
F$ = "256 Farben"
ElseIf Largo(Dev#,104) = 16
F$ = "HightColor"
ElseIf Largo(Dev#,104) = 32
F$ = "TrueColor"
EndIf
BBPSettings$ = BBPSettings$ + Str$(Largo(Dev#,104))+"|"
HSettings$ = HSettings$ + Str$(Largo(Dev#,108))+"|"
WSettings$ = WSettings$ + Str$(Largo(Dev#,112))+"|"
DD$ = Str$(Largo(Dev#,108)) + " * " + Str$(Largo(Dev#,112)) + " - " + F$
AddChoice(CB&,DD$)
Inc X&
Wend
ENDPROC
Ventana de Estilo 20
Título de la ventana "Display-Changer"
Ventana 10,10-250,150
cls ~GetSysColor(~COLOR_BTNFACE)
SetDialogFont ~GetStockObject(~DEFAULT_GUI_FONT)
Dummy$ = GetCurrentSettings()
Static& = Crear("TEXT",%hwnd,"Current Settings : "+Dummy$,10,10,300,24)
CB& = ~CreateWindowEx($200,"COMBOBOX","",~WS_CHILD | ~WS_VISIBLE | ~CBS_DROPDOWN | ~WS_VSCROLL ,10,40,220,300,%hwnd,100,%hInstance,0)
SendMessage(CB&,~WM_SETFONT,~GetStockObject(~DEFAULT_GUI_FONT),1)
OK& = Crear("BUTTON",%hwnd,"Ende",10,70,80,24)
Change& = Crear("BUTTON",%hwnd,"Change",150,70,80,24)
Dim Dev#,156
EnumDisplay()
SendMessage(CB&,~CB_SETCURSEL,SendMessage(CB&,~CB_FINDSTRING,0,ADDR(Dummy$)),0)
Sinestar encargado Ende&
Waitinput
If GetFocus(Change&)
SetFocus(%hwnd)
GC& = SendMessage(CB&,~CB_GETCURSEL,0,0)
Largo Dev#,40 = ~DM_PELSHEIGHT | ~DM_PELSWIDTH | ~DM_BITSPERPEL
Largo Dev#,104 = Val(Substr$(BBPSettings$,GC&+1,"|"))
Largo Dev#,108 = Val(Substr$(HSettings$,GC&+1,"|"))
Largo dev#,112 = Val(Substr$(WSettings$,GC&+1,"|"))
If GetText $(CB&) <> Mid$(GetText $(Static&),20,100)
If ~ChangeDisplaySettings(Dev#,~CDS_UPDATEREGISTRY) = ~DISP_CHANGE_RESTART
If Largo(Dev#,104) = 4
F$ = "16 Farben"
ElseIf Largo(Dev#,104) = 8
F$ = "256 Farben"
ElseIf Largo(Dev#,104) = 16
F$ = "HightColor"
ElseIf Largo(Dev#,104) = 32
F$ = "TrueColor"
EndIf
SetText Static&,"Current Settings : " + Str$(Largo(Dev#,108)) + " * " + Str$(Largo(Dev#,112)) + " - " + F$
Externo("setupapi.dll","SetupPromptReboot",0,0,0)
Más
SetText Static&,"Current Settings : "+GetCurrentSettings()
Endif
Más
MessageBox("Auflösung muss no geändert werden","Meldung",0)
Endif
ElseIf GetFocus(OK&)
Disponer Dev#
Ende& = 1
Endif
EndWhile
End
Salve, IF. |
|