Posted: Fri Jan 27, 2006 9:40 am
I got that right off the FAQ sticky at the top of this forum. Perhaps it could use an update?dtw=GetSystemMetrics_(#SM_CXSCREEN)
dth=GetSystemMetrics_(#SM_CYSCREEN)
http://www.purebasic.com
https://www.purebasic.fr/english/
I got that right off the FAQ sticky at the top of this forum. Perhaps it could use an update?dtw=GetSystemMetrics_(#SM_CXSCREEN)
dth=GetSystemMetrics_(#SM_CYSCREEN)
Droopy wrote:Code from DarkDragon & GillouCode: Select all
#DISP_CHANGE_SUCCESSFUL = 0 ; The settings change was successful. #DISP_CHANGE_RESTART = 1 ; The computer must be restarted in order for the graphics mode to work. #DISP_CHANGE_BADFLAGS = -4 ; An invalid set of flags was passed in. #DISP_CHANGE_FAILED = -1 ; The display driver failed the specified graphics mode. #DISP_CHANGE_BADMODE = -2 ; The graphics mode is not supported. #DISP_CHANGE_NOTUPDATED = -3 ; Windows NT only: Unable to write settings to the registry. ProcedureDLL ChangeDisplaySettings(width,height,Depth,Freq,Permanent) dmScreenSettings.DEVMODE dmScreenSettings\dmSize = SizeOf(dmScreenSettings) dmScreenSettings\dmPelsWidth = width dmScreenSettings\dmPelsHeight = height dmScreenSettings\dmBitsPerPel = Depth dmScreenSettings\dmDisplayFrequency=Freq dmScreenSettings\dmFields = 262144 | 524288 | 1048576 If Permanent retour=ChangeDisplaySettings_(@dmScreenSettings, 1) Else retour=ChangeDisplaySettings_(@dmScreenSettings, 4) EndIf ProcedureReturn retour EndProcedure ;/ Test ChangeDisplaySettings(1024,768,16,70,0) MessageRequester("Change Display Settings","OK to Restore")
Code: Select all
dmScreenSettings\dmFields = 262144 | 524288 | 1048576
Code: Select all
dmScreenSettings\dmFields = 262144 | 524288 | 1048576 | 4194304
DOH!netmaestro wrote:Change the line:to:Code: Select all
dmScreenSettings\dmFields = 262144 | 524288 | 1048576
to include the displayfrequency in the selected fields. Right now all you've got in there is width, height and depth. If you don't specify a field, it won't be modified.Code: Select all
dmScreenSettings\dmFields = 262144 | 524288 | 1048576 | 4194304
Code: Select all
dmScreenSettings\dmFields = #DM_PELSWIDTH | #DM_PELSHEIGHT | #DM_BITSPERPEL | #DM_DISPLAYFREQUENCY
Yes by changing the second value of "ChangeDisplaySettings". Just look it up in windows api to get the correct value.TheCorporation wrote:Is it possible to let the change made to resolution when quitting Pure Basic ?
(Because this source code (or PB ?) get back to default settings when ending).