Jump to content
  • Advertisement
Sign in to follow this  
Nanven

Hiding/disabling title bars in Win32 API

This topic is 4726 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
Advertisement
As long as your windowstyle doesn't include anything requiring a title bar (sysmenu or overlapped, for instance) a titlebar won't appear.

Share this post


Link to post
Share on other sites
When you create your window, for the flags, instead of using WS_OVERLAPPEDWINDOW, use WS_POPUP or WS_POPUPWINDOW. As long as you set the window size to be less than the screen, it should just be a box without a border or title bar.

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
You are only using the WS_MAXIMIZED style you need to do WS_MAXIMIZE | WS_POPUP or like I mentioned above you can call SetWindowLong to change the style.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!