I'm playing with the ChangeDisplaySettings api, trying to translate some vb code. It's working, except that the display area moves in. It's hard to explain (for me anyways), but there's a black strip along the bottom and right side of the screen after this code runs. Maybe the equates are wrong? Maybe I'm not setting all of the necessary members of the devmode struct? Maybe I'm just a bad programmer?

Anyways, here's the code. Maybe someone can point out a glaring error?


DM_PELSWIDTH equ 080000h
DM_PELSHEIGHT equ 0100000h
DM_BITSPERPEL equ 040000h

.data
myDevMode DEVMODE <>

.code
start:
mov myDevMode.dmPelsWidth,1152;1024
mov myDevMode.dmPelsHeight,864;768
mov myDevMode.dmBitsPerPel,32
mov myDevMode.dmFields,DM_PELSWIDTH Or DM_PELSHEIGHT Or DM_BITSPERPEL
mov myDevMode.dmSize,sizeof myDevMode
invoke ChangeDisplaySettings,addr myDevMode,0


cheers,
will
Posted on 2003-07-01 11:50:29 by Will