# Windows programming,

## Recommended Posts

Dogh Quch    122

##### Share on other sites
Illco    928
This page gives the possible values for the window style. You can combine them to produce mixed effects. The trick here is the following.

One of the styles, WS_OVERLAPPEDWINDOW, is a sort of wrapper for a number of styles (see the page for details). It includes the flags for the boxes. To obtain the desired effect, you should (1) remove WS_OVERLAPPEDWINDOW, (2) include the flags defined for WS_OVERLAPPEDWINDOW, (3) except for the min/max box flags.

This brings us to:
// Window styleWS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME

Greetz,

Illco

##### Share on other sites
Dogh Quch    122
Thanks Illco.

How stupid am I? now I see were I was mistaken....
I must have read that thing 3 times just this morning and didn't realize that.

Just one more thing, how do I change from windowed mode to full screen mode?
I don't want to create a full screen window, I have a window opened and I want to change it to full screen when the user choose to.

##### Share on other sites
twkr    162
you might want to try WS_POPUP|WS_BORDER|WS_DLGFRAME so that the window cannot be resized if you are getting rid of min and max.

##### Share on other sites
Dave Hunt    4872
Quote:
 Original post by Dogh Quch Just one more thing, how do I change from windowed mode to full screen mode? I don't want to create a full screen window, I have a window opened and I want to change it to full screen when the user choose to.

See ChangeDisplaySettings.

##### Share on other sites
Well, this could be useful, though Its made fullscreen by default, maybe look around the code a bit for a solution that involves the user's choice

##### Share on other sites
Dogh Quch    122
ChangeDisplaySettings doesn't look like what I want to do.

This program I'm building is just a skeleton to a directX based program.
The fist screen will be just a window with some menu option and a big logo image, so the user may configure the application, but it should be in full screen mode when running.

So, this function mess with the windows display settings and I would like to stay as far as possible from windows! Besides, It's safer to let directX deal with the display sittings.

Maybe I didn't understand how it actually work, but I was unable to produce the effect I wished.

I'll keep trying...

##### Share on other sites
Origanlmaxin    122
i may be mistaken Dogh Quch, but i think this command may do it?

ChangeDisplaySettings(NULL,0);

and i think changing the 0 to a 1 makes it fullscreen.. i havent tested it but it looks to be the part of the program to change fullscreen :D

##### Share on other sites
Dogh Quch    122
I tested...it did nothing!

ChangeDisplaySettings(NULL,0) will just restore de default dysplay settings (I'm assuming its the windows settings).

Theoretically, to change to full screen would be like this: ChangeDisplaySettings (NULL, CDS_FULLSCREEN);

Maybe I'm using it the wrong way...how would you use it? I mean, just calling the function should do the job or it need some work before/after the function call?

##### Share on other sites
Dave Hunt    4872
Quote:
 Original post by Dogh Quch This program I'm building is just a skeleton to a directX based program.

Ok. That changes everything. For DirectX, fullscreen/windowed is handled by the device. When you create the device, you tell it whether you want fullscreen or windowed. If the device is already created, then you can flip between fullscreen/windowed using the Reset method of the device interface.

##### Share on other sites
Dogh Quch    122
It took some time but I found it!

To change the window attributes you must first call this function: SetWindowLongPtr.
Than, you call SetWindowPos to make the changes take effect.

I already changed the screen size and took out the menu bar. I'm still unable to make a complete full screen, but I'm on the right trek now.

Tanks for the help guys!