473,388 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Customising a windows close buttons and title bar

Hi all,

Some applications achieve a really nice look and feel in part because they
have changed the bar at the very top of the form window. There appears to
be a way to customise the whole bar and its buttons but I have no idea how
its done.

Can anyone point me in the right direction. Perhaps towards a tutorial or
something. I've looked myself but I'm not sure what to search for in google

Thanks

Simon

Nov 16 '05 #1
7 2167
There are multiple ways of doing this.

Win32 - you could get the handle of the titlebar and then do whatever you
wished with it. That causes some pain with the teletubbies default XP look.
So I wouldn't recommend that.

The better way is to go change the window style to the 5th property (I
forgot the name), then it appears as just a canvas. You can then write
whatever you want to make it look like, and it won't interfere with the
teletubbies or barney look that XP might come up with in future.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/

"thechaosengine" <na> wrote in message
news:20*********************@news.microsoft.com...
Hi all,

Some applications achieve a really nice look and feel in part because they
have changed the bar at the very top of the form window. There appears to
be a way to customise the whole bar and its buttons but I have no idea how
its done.

Can anyone point me in the right direction. Perhaps towards a tutorial or
something. I've looked myself but I'm not sure what to search for in
google

Thanks

Simon

Nov 16 '05 #2
SM> Win32 - you could get the handle of the titlebar and then do
SM> whatever you wished with it.

Pardon me, what is the "handle of the titlebar"?

--
Serge
Nov 16 '05 #3
tn> Some applications achieve a really nice look and feel in part
tn> because they have changed the bar at the very top of the form
tn> window. There appears to be a way to customise the whole bar and its
tn> buttons but I have no idea how its done.

Look at the WM_NCCALCSIZE, WM_NCPAINT, WM_NCHITTEST messages. By them you
tell Windows whether the particular point of your window is a title bar,
or close box, or system menu, etc, and draw whatever you wish on them. That's
WinAPI of course.

PS in most cases, the customized look appears to be worse than the standard
one, as Microsoft has skilled UI designers, after all :)

--
Serge
Nov 16 '05 #4
Every window in windows can be gotten a hold of using it's Win32 Handle. The
titlebar is nothing but yet another window.

- Sahil Malik
http://codbetter.com/blogs/sahil.malik

"Serge Baltic" <ns*@hypersw.net> wrote in message
news:c8**************************@news.microsoft.c om...
SM> Win32 - you could get the handle of the titlebar and then do
SM> whatever you wished with it.
Pardon me, what is the "handle of the titlebar"?
--
Serge

Nov 16 '05 #5
The titlebar is nothing but yet another window.


No, the titlebar is not a separate window. To draw in it you have to
handle the WM_NC* window messages.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #6
You might try looking in Petzold's book, Programming Windows With C#. It
has a good description of how to do the things you're talking about doing.

HTH

DalePres
MCAD, MCDBA, MCSE

"thechaosengine" <na> wrote in message
news:20*********************@news.microsoft.com...
Hi all,

Some applications achieve a really nice look and feel in part because they
have changed the bar at the very top of the form window. There appears to
be a way to customise the whole bar and its buttons but I have no idea how
its done.

Can anyone point me in the right direction. Perhaps towards a tutorial or
something. I've looked myself but I'm not sure what to search for in
google

Thanks

Simon

Nov 16 '05 #7
I stand corrected. I just checked, it is indeed not a window.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:e#**************@TK2MSFTNGP15.phx.gbl...
The titlebar is nothing but yet another window.


No, the titlebar is not a separate window. To draw in it you have to
handle the WM_NC* window messages.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ajay | last post by:
hi! i have two tkinter windows on top of each other. i would like it so that the user has to complete the fields in the top windows before they can interact with the window below it. that is, i...
4
by: moose | last post by:
OK Popup window? No problem PDF in popup? No problem But what about a couple of Close Window buttons? Imagine a "Close Window" button at the top of the popup page. Then the PDF which can...
2
by: Phil Stanton | last post by:
When designing a new form or report, the Default ForeColor is often something like -2147483640 which is the colour of Windows text (possibly black) and the default backColor is -2147483643...
1
by: Christoph Engelhardt | last post by:
Hi newsgroup, What I intend to do: Write a small programm, that will add a new Button to every Window right beside the Buttons for minimizing, maximizing and closing the window in the window's...
1
by: DwC | last post by:
Hey All, I have about six mdi windows and when i maximize them all of them except for two still have their own title bar. When i maximize the other two the minimize, maximize and close buttons...
3
by: Dan | last post by:
i really need to create a window/dialog that just contains a bitmap and nothing else - no window frame, caption or buttons, or any sign of a grey background. so far ive only managed to get rid of...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
9
by: mohit.akl | last post by:
Hey guys & gals I am havng trouble modifying the control box. I want to make the maximise button invisible and have minimisise button instead of it. Like this _ X (not like _ o X ) How...
1
by: SeanBoyWalton | last post by:
Hi, I'm currently trying to build a website for a DJ friend of mine and I have come stuck with a couple of issues. I've searched everywhere and put some code together but I still have problems. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.