WIN API & Fullscreen

Started by
2 comments, last by persil 18 years, 8 months ago
Is there any way to set fullscreen with WIN API like in SDL??
Advertisement
According to MSDN, you can create a window that is automatically maximized by passing WS_MAXIMIZE as the dwstyle in the CreateWindow() function.

See, now I don't even program in Win32, I did for maybe a month two years ago but just looking through MSDN for 5 minutes helps you find the answer.

Win32 CreateWindow() function
Window styles
If you mean fullscreen like in actually changing resolution, there's a ChangeDisplaySettings function or somesuch for that (been a while since I did win32 stuff).
---Mikael Lax
In a lib I wrote, a GDI only graphics lib, to get a fullscreen window I can write unto like a fullscreen surface, I used these:

- Like someone mentionned, you use ChangeDisplaySettings to set the mode you want ( and don't forget to always call it with NULL values when exiting your program, or the user is stuck in the resolution you set )

- You create a window with no borders, no title, no buttons, no nothing, say it to be always on top ( otherwise, stuff might pop over it ) and with the exact size of the screen and position 0,0. That should work.

- You should handle minimizing and some stuff yourself then, otherwise the user is stuck in your app until it closes it for good.

Hope it helps.

This topic is closed to new replies.

Advertisement