flat assembler
Message board for the users of flat assembler.

Index > Windows > Fullscreen issues...

Author
Thread Post new topic Reply to topic
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak 18 Jun 2007, 04:37
Tried to take an already completed project and turn it into a screen saver... And for some reson it's not showin' up. The error comes out fine. I spent a couple hours looking this over and still can't find it. Can anyone do me a favor and look it over for me? Thanks in advance.

Code:
        mov [fullscreen.dmPelsHeight],1024
        mov [fullscreen.dmPelsWidth],1280
        mov [fullscreen.dmBitsPerPel],32
        mov [fullscreen.dmSize], rawr2-rawr1
        mov [fullscreen.dmFields], DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT
invoke  ChangeDisplaySettings, fullscreen, CDS_FULLSCREEN

        cmp eax, DISP_CHANGE_SUCCESSFUL
        je noclose
invoke  MessageBoxA, HWND_DESKTOP, 0, 0, MB_OK
invoke  ExitProcess, 0
noclose:

        mov [wMain.hInstance], handle
invoke  LoadIcon, 0, IDI_APPLICATION
        mov [wMain.hIcon], eax
invoke  LoadCursor, 0, IDC_ARROW
        mov [wMain.hCursor], eax
invoke  RegisterClass, wMain
invoke  CreateWindowEx, WS_EX_APPWINDOW, Class, tMain, WS_POPUP or WS_VISIBLE or WS_CLIPCHILDREN\
                        or WS_CLIPSIBLINGS,CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, handle,\
                        NULL
        mov [hMain], eax           


EDIT: Note to self and others for future referance... All that display settings thing'll ever do is change the screen settings and annoy people with long loading. For a decent screen saver, you don't want to change the screen size... So, just change the windows size (which is what you have to do anyway, changing the size of the screen or not) and with WS_POPUP, that'll work fine in giving a full screen effect.

Code:
invoke  GetSystemMetrics, SM_CXSCREEN
        mov ebx, eax
        push ebx
invoke  GetSystemMetrics, SM_CYSCREEN
        pop ebx
invoke  CreateWindowEx, WS_EX_APPWINDOW, Class, tMain, WS_VISIBLE or WS_CLIPCHILDREN or WS_POPUP\
                        or WS_CLIPSIBLINGS,0, 0, ebx, eax, NULL, NULL, handle,\
                        NULL        
Post 18 Jun 2007, 04:37
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.