471,356 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

New icon in ControlBox

Hello,

I Would like to add a new icon near the close/minimiez/maximize button in a
winfor
Did someone know how to do it ?

Thanks in advance
Franck

Jul 28 '08 #1
1 1482
There's no built-in functionality for doing this. You need to override the
WM_NCPAINT message, allow the non-client area to paint, and then paint your
button on top of it. You'll also need to handle WM_NCLBUTTONDOWN/UP, etc.
Basically, it's like a special-case custom control. I've never done this
from .NET, so yo may be able to do this from OnNcPaint and OnNcLButtonDown,
etc...

But it's not like adding a button to a form at all. Also, your button won't
pick up theme settings, so your button may look completely wrong. One way of
dealing with it is to somehow create a screenshot of one of the existing
buttons (minimize, close, maximize) and then use that to determine how to
draw the button similar to the theme.

"Franck FJ. Jobard" <Fr***********@PIERREMAUCHAMP.COMwrote in message
news:OL**************@TK2MSFTNGP02.phx.gbl...
Hello,

I Would like to add a new icon near the close/minimiez/maximize button in
a winfor
Did someone know how to do it ?

Thanks in advance
Franck

Jul 28 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Microsoft | last post: by
8 posts views Thread by Adrian | last post: by
1 post views Thread by Rookie | last post: by
4 posts views Thread by Jacob | last post: by
2 posts views Thread by Tim | last post: by
13 posts views Thread by Sylo | last post: by
3 posts views Thread by krishna | last post: by
2 posts views Thread by Peter Stojkovic | last post: by
1 post views Thread by Saso Zagoranski | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.