Sign in to follow this  

Hiding/disabling title bars in Win32 API

This topic is 4354 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, this is kind of silly but i've done tons of searching and haven't found exactly what I was looking for. Found tons of ways to remove it in VB or MFC applications but when using just the bare bones Win32 API I can't figure out for the life of me how to disable the title bar of a window so it doesn't show up(kind of like full screen mode without actually being full screen or using DirectX) I just don't want the title bar. How do you do this with just the Win32 API?

Share this post


Link to post
Share on other sites
If you want to change it during runtime you can call SetWindowLong with the GWL_style flag. ex:

if(bFullScreen)
SetWindowLong(hWnd,GWL_STYLE,WS_POPUP);
else
SetWindowLong(hWnd,GWL_STYLE,WS_OVERLAPPED);



Share this post


Link to post
Share on other sites
It's a matter of using the correct combination of dwstyle and dwExstyle flags to the CreateWindowEx (or CreateWindow) function. But don't ask which combination :). You might also need to modify your WNDCLASSEX. Best bet is to look in MSDN and some trail-and-error.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
As long as your windowstyle doesn't include anything requiring a title bar (sysmenu or overlapped, for instance) a titlebar won't appear.


That's what I thought but here's what I have right now:


// The WCEX def
WNDCLASSEX wcex;
wcex.cbClsExtra = 0;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.cbWndExtra = 0;
wcex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hIcon = 0;
wcex.hIconSm = 0;
wcex.hInstance = hInstance;
wcex.lpfnWndProc = WinProc;
wcex.lpszClassName = "Fun";
wcex.lpszMenuName = NULL;
wcex.style = 0;

// and the create window
HWND hWnd = CreateWindowEx(NULL, "Fun", "", WS_MAXIMIZE, 0, 0, 1024, 800, NULL,
NULL, hInstance, NULL);






and it's still showing up... thus my confusion.. however, using WS_POPUP in CreateWindowEx seemed to of do the trick :) Thanks for the help.

Share this post


Link to post
Share on other sites

This topic is 4354 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this