views:

228

answers:

2

I am making a C++/Windows/DirectX program, and when it runs in windowed mode (using

d3dpp.Windowed = (!FULLSCREEN);

where FULLSCREEN is defined as 0), the three icons that are usually at the top of any window (minimize, maximize/restore, and close) are not there. Also, it's not like just an image with no border or anything, it looks identical to a normal window, minus the aforementioned three icons.

So, what could cause a window to lose the three icons in the top corner without changing any other aspect of it?

+2  A: 

You don't tell how the window is created for you. When programming plain Win32, you create windows with the CreateWindow() or CreateWindowEx() functions, which you pass some window style flags. The WS_MINIMIZEBOX and WS_MAXIMIZEBOX flags do what you'd expect, while the WS_SYSMENU flag controls both the addition of the close button and the window icon in the top left. If none of those three flags are set for the window, it will have no buttons.

nielsm
Yeah, the error was in the `style` parameter of `CreateWindow()`, but I used `WS_OVERLAPPEDWINDOW` instead of the flags you mentioned.
Keand64
A: 

If your directx app lives inside a winmain, for example:

int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR     lpCmdLine,
                   int       nCmdShow)

then the window manager is given it's instructions on what buttons to manage in your CreateWindow call.

DaveParillo