Custome title bar
-
-
Hello, I need to create some control on title bar of title bar but thought it better to remove title bar and create our own custom title bar. Please suggest how to create own title bar which could move the windows and add other options as well.
You probably need to create some sort of subclassed window in order to override the defaults. See Window Styles (Windows)[^] and CWindowImpl Class[^].
-
Hello, I need to create some control on title bar of title bar but thought it better to remove title bar and create our own custom title bar. Please suggest how to create own title bar which could move the windows and add other options as well.
This article: [A Technique to Customize the Title Bar of Windows](https://www.codeproject.com/Articles/4471/A-Technique-to-Customize-the-Title-Bar-of-Windows) may be a good start.
-
Hello, I need to create some control on title bar of title bar but thought it better to remove title bar and create our own custom title bar. Please suggest how to create own title bar which could move the windows and add other options as well.
The most basic thing to do for your need is to handle the WM_NCHITTEST[^] message. The
LPARAM
parameter gives you the mouse coordinates on your window and then you figure out if it is over your customized title bar and returnHTCAPTION
from the message handler. You may also want to check when to returnHTCLOSE
,HTMAXBUTTON
,HTMINBUTTON
,HTSYSMENU
etc.«_Superman_» _I love work. It gives me something to do between weekends.
_Microsoft MVP (Visual C++) (October 2009 - September 2013)