Windows - DEVMODE

new topic     » topic index » view thread      » older message » newer message

The following bit of code is supposed to set the screen resolution to 
640X480 but it doesn't change.  (I have my screen set to 1024X768)
This works when I code it in C.  Therefor, I believe I may have the 
wrong offsets for the structure members, but I'm not sure.

dmScreenSettings = allocate(148)  --DEVMODE structure
mem_set(dmScreenSettings,0,148)  --clear smScreenSettings
poke(dmScreenSettings + 36,148)   --dmSize
poke4(dmScreenSettings + 
40,or_all({DM_BITSPERPEL,DM_PELSWIDTH,DM_PELSHEIGHT}))  -- dmFields
poke4(dmScreenSettings + 91, 24)  -- dmBitsPerPel
poke4(dmScreenSettings + 95, 640)   --dmPelWidth
poke4(dmScreenSettings + 99, 480)  --dmPelHeight
if c_func(ChangeDisplaySettingsA,{dmScreenSettings,CDS_FULLSCREEN}) != 
DISP_CHANGE_SUCCESSFUL then
        retval =  message_box("The requested fullscreen mode is not 
supported by\nyour video card. ", "Error", or_bits(MB_OK,MB_ICONSTOP))
end if

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu