Is there anyone who can help me out? I want to set a full screen mode. But it doesn't seem to work. My program causes the screen to flicker but it doesn?t set the mode all it does set a popup window with 800x600 size.
Here?s my code...
DM_BITSPERPEL equ 40000
DM_PELSWIDTH equ 80000
DM_PELSHEIGHT equ 100000
...
local dwFullscreen:DEVMODE
...
mov dwFullscreen.dmSize, sizeof dwFullscreen
mov dwFullscreen.dmPelsWidth, 800
mov dwFullscreen.dmPelsHeight, 600
mov dwFullscreen.dmBitsPerPel, 16
mov dwFullscreen.dmFields, DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT
invoke ChangeDisplaySettings, addr dwFullscreen, CDS_FULLSCREEN
.if (eax != DISP_CHANGE_SUCCESSFUL)
invoke MessageBox, NULL, addr MsgDisplayErr, addr MsgErrorCaption, MB_ICONERROR
.endif
mov dwExStyle, WS_EX_APPWINDOW
mov dwStyle, WS_POPUP or WS_CLIPSIBLINGS or WS_CLIPCHILDREN
mov dwSize.top, 0
mov dwSize.left, 0
mov eax, 800
mov ebx, 600
...
invoke CreateWindowEx, dwExStyle,
addr ClassName, addr DisplayName,
dwStyle,
dwSize.left, dwSize.top, eax, ebx,
NULL, NULL,
hInstance, NULL
If anyone can point me in the right direction I would appreciate that. That MessageBox doesn?t appear.
Here?s my code...
DM_BITSPERPEL equ 40000
DM_PELSWIDTH equ 80000
DM_PELSHEIGHT equ 100000
...
local dwFullscreen:DEVMODE
...
mov dwFullscreen.dmSize, sizeof dwFullscreen
mov dwFullscreen.dmPelsWidth, 800
mov dwFullscreen.dmPelsHeight, 600
mov dwFullscreen.dmBitsPerPel, 16
mov dwFullscreen.dmFields, DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT
invoke ChangeDisplaySettings, addr dwFullscreen, CDS_FULLSCREEN
.if (eax != DISP_CHANGE_SUCCESSFUL)
invoke MessageBox, NULL, addr MsgDisplayErr, addr MsgErrorCaption, MB_ICONERROR
.endif
mov dwExStyle, WS_EX_APPWINDOW
mov dwStyle, WS_POPUP or WS_CLIPSIBLINGS or WS_CLIPCHILDREN
mov dwSize.top, 0
mov dwSize.left, 0
mov eax, 800
mov ebx, 600
...
invoke CreateWindowEx, dwExStyle,
addr ClassName, addr DisplayName,
dwStyle,
dwSize.left, dwSize.top, eax, ebx,
NULL, NULL,
hInstance, NULL
If anyone can point me in the right direction I would appreciate that. That MessageBox doesn?t appear.
#define DM_BITSPERPEL 0x00040000L
#define DM_PELSWIDTH 0x00080000L
#define DM_PELSHEIGHT 0x00100000L
those are hexadecimal notated numbers not decimal ones adapt your constants appropriately :)
#define DM_PELSWIDTH 0x00080000L
#define DM_PELSHEIGHT 0x00100000L
those are hexadecimal notated numbers not decimal ones adapt your constants appropriately :)