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)
Set desktop metrics
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Last edited by netmaestro on Tue Feb 21, 2006 7:58 pm, edited 2 times in total.
BERESHEIT
I can't seem to get it to change the frequency?
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")
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Change the line:
to:
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
Code: Select all
dmScreenSettings\dmFields = 262144 | 524288 | 1048576 | 4194304
BERESHEIT
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

Thanks!

www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
It's possible the code you're using was written for a version of PureBasic that didn't have these devmode constants defined. PureBasic 4.0 has them, so it really would be more readable (and easier to notice something missing!) if you write it this way:
Code: Select all
dmScreenSettings\dmFields = #DM_PELSWIDTH | #DM_PELSHEIGHT | #DM_BITSPERPEL | #DM_DISPLAYFREQUENCY
BERESHEIT
-
- User
- Posts: 11
- Joined: Fri Sep 15, 2006 8:04 am
- Location: FR
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).
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.