display caps

Blitz3D Forums/Blitz3D Programming/display caps

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If only I could define a proper type and retrieve lpDevMode into that... I've got the VB type but I can't transcribe that into blitz code. http://vbnet.mvps.org/index.html?code/enums/enumdisplay.htm
Public Type DEVMODE
   dmDeviceName      As String * CCDEVICENAME
   dmSpecVersion     As Integer
   dmDriverVersion   As Integer
   dmSize            As Integer
   dmDriverExtra     As Integer
   dmFields          As Long
   dmOrientation     As Integer
   dmPaperSize       As Integer
   dmPaperLength     As Integer
   dmPaperWidth      As Integer
   dmScale           As Integer
   dmCopies          As Integer
   dmDefaultSource   As Integer
   dmPrintQuality    As Integer
   dmColor           As Integer
   dmDuplex          As Integer
   dmYResolution     As Integer
   dmTTOption        As Integer
   dmCollate         As Integer
   dmFormName        As String * CCFORMNAME
   dmUnusedPadding   As Integer
   dmBitsPerPel      As Integer
   dmPelsWidth       As Long
   dmPelsHeight      As Long
   dmDisplayFlags    As Long
   dmDisplayFrequency As Long
End Type


These two (dmPelsWidth, dmPelsHeight) are the resolution.

So, what I came up with, is a way to scan through the bank that I end up reading in devmode:
devmode% = CreateBank (1000)

rc% = api_EnumDisplaySettings (0, 1, devmode%)
Print rc
Print "Device Name :" + get_string_from_bank$(devmode)
WaitKey()


Function get_string_from_bank$(bank%, offset% = 0)
   a$ = ""
   eol% = False
   While eol = False
      char% = PeekByte(bank, offset)
      If char = 0 Then
         eol = True
      Else
         a$ = a$ + Chr$(char)
         offset = offset + 1
      EndIf
   Wend
   Return a$
End Function

It's just a starting point.