Removing title bar from app

I'm creating a small notepad program and for learning purposes I wanted to remove the system title bar (The bar at the top of most programs with the title, icon, and minimize, maximize and close[x] buttons). Below is the code used to create the window. Still new to the Win32api stuff, so even the way I create the window may not be ideal.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
		HWND WindowHandle = 
			CreateWindowEx(
				0,
				WindowClass.lpszClassName,
				"My Notepad",
				WS_OVERLAPPEDWINDOW | WS_VISIBLE,
				CW_USEDEFAULT,
				CW_USEDEFAULT,
				CW_USEDEFAULT,
				CW_USEDEFAULT,
				0,
				0,
				Instance,
				0);
The 4th parameter to your CreateWindowEx() call is the style of the window to create. The WS_OVERLAPPEDWINDOW style includes, I believe, a title bar. You can check out the styles in the MSDN CreateWuindowEx() documentation. So if you don't want a title bar simply use style combinations that don't include one.
Last edited on
Alright so removing WS_OVERLAPPEDWINDOW gets rid of the minimize, maximize, close buttons, however the title bar itself is still there, just without the top right buttons. I'm still digging around MSDN to see what might work.
You want a borderless window. Sadly, AFAIK there is no way to have a window with borders but without the title bar.
It's tecnically possible (right click something on the W7 taskbar: that's title-less bordered).

Try WS_DLGFRAME or WS_POPUP.
I guess changing the title bar to black would be sufficient as well but I think with Microsofts way of giving every version of windows a different look and style for a windows title bar makes this impractical.
Last edited on
Take this screenshot for example: http://i.imgur.com/Lll9PCy.png

Visual Studios title bar and main app color blend to be the same color where as I have a giant white(ish) title bar and black background app. Just trying to blend them in that manor.
Visual Studio disables the default window border and draws its own. (Personally I hate it when software does that, but whatever.)
Fair enough. Just seems easier on the eyes in this case with a black background app.
Topic archived. No new replies allowed.