
#case capital

uses MinWin


'TESTS
'=====

'#recordof _devicemode

library "user32.dll"
Declare EnumDisplaySettings Alias "EnumDisplaySettingsA" (sys lpszDeviceName, iModeNum , DEVMODE*lpDevMode) As bool
Declare ChangeDisplaySettings Alias "ChangeDisplaySettingsA" (DEVMODE*lpDevMode, long dwflags) As Long
library ""

DEVMODE DevM
sys a, i, b, TmpW, TmpH

Do
  a = EnumDisplaySettings(0, i, DevM)
  i++
  if a=0 then exit do 
End Do

print "Number of Screen Modes: " i

'----
'cr=chr(13)+chr(10)
'pr="dev data:" cr cr
'long * d : &d=DevM
'for i=18 to 31 : pr+=hex(d[i]) cr : next
'print pr
'----

TmpW = DevM.dmPelsWidth
TmpH = DevM.dmPelsHeight

'print structureof DevM

'print "  " tmpw "  " tmph

DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
DevM.dmPelsWidth  = 800
DevM.dmPelsHeight = 600

'b = ChangeDisplaySettings(DevM, 0) '&DevM !
'print "ok"

'previous resolution !
DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
DevM.dmPelsWidth  = TmpW
DevM.dmPelsHeight = TmpH

'b = ChangeDisplaySettings(DevM, 0) '&DevM !
''b = ChangeDisplaySettings(0, 0) '&DevM !
'print "ok"