Thanks DGuy, I'll look into this tomorrow. I didn't look properly, the 2 strings in the DEVMODE make 32 bytes each, so this is a fixed value. I tought they were variable in length, that is why I was checking for nulls in my string function. Resolutions are easy to catch, but I'm not sure if these are what I wanted in the first place, since EnumDisplaySettings is giving resolution sup to 2048x1536, which my monitor clearly can't display, at any refresh rate. But I have to look into the flags to see if something indicates that it's out of the monitor's range.
I'll try to apply what MS recommends. Thanks for the find.
Graphics 1024,768,32,2 devmode% = CreateBank (200) mode% = 0 rc% = 1 modes_in_page% = 0 While rc rc% = api_EnumDisplaySettings (0, mode%, devmode%) BitsPerPel% = PeekShort (devmode, 104) PelsWidth% = PeekInt (devmode, 108) PelsHeight% = PeekInt (devmode, 112) DisplayFrequency% = PeekShort (devmode, 120) If BitsPerPel >= 4 And DisplayFrequency > 1 Then Select BitsPerPel Case 4 : bppType$ = "16 Color " Case 8 : bppType$ = "256 Color " Case 16 : bppType$ = "High Color " Case 24, 32: bppType$ = "True Color " Default : bppType$ = "" End Select Write bppType$ Write Str$(PelsWidth) + "x" + Str$(PelsHeight) + " " Write Str$(DisplayFrequency) + "hz" Print "" EndIf mode = mode + 1 Wend WaitKey() End
I'll try to apply what MS recommends. Thanks for the find.