Add custom button on title bar

M

Marcolino

Hi all,
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
I need also to handle OnClick event of this button. I looked around
google but i'm not able to find any example that can help me.

Many thanks in advance for your help.

Marco
 
P

Phill W.

Marcolino said:
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)

Why?

Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?
I looked around google but i'm not able to find any example that can
help me.

Which ought to suggest that, perhaps, it's not a very good thing to do...

Regards,
Phill W.
 
M

Marcolino

Why?

Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?


Which ought to suggest that, perhaps, it's not a very good thing to do...

Regards,
Phill W.

Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.
To make this I subclassed System message to a form and now i'm able to
run my custom code. But after this, the Maximize button will not
change to minimize.
I tried with SetWindowLong and then SetWindowPos, but this change the
button but also maximize the form and I do not need this.
So I think to disable standard Maximize/restore button and to add a
new customized one, so I'll be able to make whatever I want.
I hope this is clear for you and the reason for may need.
Many thanks for your attention.

--Marco
 
P

Phill W.

Marcolino said:
Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.

Again, I ask .. why?

*Every* other Windows application that shows these buttons (you /can/
just hide them, BTW) behaves in exactly the same way. They have done
for years and (hopefully) will continue to do so for years to come.
Users are /familiar/ with this and "expect" [all] their applications to
work this way.

If you change this behaviour, especially if you are tinkering with an
area of the window that is normally /outside/ of an application's
control and should be the same for /every/ window shown to the user,
then you're going to confuse and alienate your user community.
the Maximize button will not change to minimize.

And I should hope not!
If I click a Maximise button on any window, I expect that window to
maximise itself. Your application is going to do something different?
Expect to be flooded with "bug reports" from your users.

Take a step back for your current problem and tell us what it is that
you want to /achieve/ (not how). Why do you want to change the
behaviour of these buttons? We might be able to give you a more
"standard" (i.e. more familiar, user-friendly, etc.) alternative.

Regards,
Phill W.
 
M

Mythran

Phill W. said:
Marcolino said:
Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.

Again, I ask .. why?

*Every* other Windows application that shows these buttons (you /can/ just
hide them, BTW) behaves in exactly the same way. They have done for years
and (hopefully) will continue to do so for years to come. Users are
/familiar/ with this and "expect" [all] their applications to work this
way.

Not really Phill. I have used several windows applications that contain
custom titlebar buttons. Hmm, I believe most of these apps were installed
via video card bundled software and they allow you to do many things with
the "window" that has nothing to do with the application. Of course, this
was a modification to ALL applications installed, and not just it's own
application. The button I am remember for 1 case was actually a context
menu when you clicked on it and allowed you to change the resolution of the
window, size, colors, etc. Pretty nifty for the advanced use...

Mythran
 
R

rowe_newsgroups

Again, I ask .. why?
*Every* other Windows application that shows these buttons (you /can/ just
hide them, BTW) behaves in exactly the same way. They have done for years
and (hopefully) will continue to do so for years to come. Users are
/familiar/ with this and "expect" [all] their applications to work this
way.

Not really Phill. I have used several windows applications that contain
custom titlebar buttons. Hmm, I believe most of these apps were installed
via video card bundled software and they allow you to do many things with
the "window" that has nothing to do with the application. Of course, this
was a modification to ALL applications installed, and not just it's own
application. The button I am remember for 1 case was actually a context
menu when you clicked on it and allowed you to change the resolution of the
window, size, colors, etc. Pretty nifty for the advanced use...

Mythran

I believe Phill was talking about changing the behavior of the
"default" buttons (minimize, restore, maximize, close) and not about
additional custom buttons (like NVidia's nview titlebar buttons).

Thanks,

Seth Rowe
 
M

Marcolino

Marcolino wrote:
On 2 Mag, 18:12, "Phill W." <[email protected]>
wrote:
Marcolino wrote:
I need to add a custom button to title bar on a form in addition of a
standard button. (Minimize/Maximize, close etc.)
Why?
Unless you're doing something very, /very/ specialised, what does this
gain you or, more importantly, your users that you /can't/ achieve in a
more "standard" Windows way?
I looked around google but i'm not able to find any example that can
help me.
Which ought to suggest that, perhaps, it's not a very good thing to
do...
Regards,
Phill W.
Hi Phil,
I have my reason to do this. In deep I need to change the behavior of
Maximize/Restore Button on a form.
Again, I ask .. why?
*Every* other Windows application that shows these buttons (you /can/ just
hide them, BTW) behaves in exactly the same way. They have done for years
and (hopefully) will continue to do so for years to come. Users are
/familiar/ with this and "expect" [all] their applications to work this
way.
Not really Phill. I have used several windows applications that contain
custom titlebar buttons. Hmm, I believe most of these apps were installed
via video card bundled software and they allow you to do many things with
the "window" that has nothing to do with the application. Of course, this
was a modification to ALL applications installed, and not just it's own
application. The button I am remember for 1 case was actually a context
menu when you clicked on it and allowed you to change the resolution of the
window, size, colors, etc. Pretty nifty for the advanced use...

I believe Phill was talking about changing the behavior of the
"default" buttons (minimize, restore, maximize, close) and not about
additional custom buttons (like NVidia's nview titlebar buttons).

Thanks,

Seth Rowe- Nascondi testo tra virgolette -

- Mostra testo tra virgolette -

Hi All,
Phil I'm Italian and I'm not write English very well, but in any way I
will try to explain you and all other guys my needs.

So, the truth is that the maximize button on my app will operate as
Microsoft want, maximizing the form but in a little bit different way.
I'm trying to explaing..............
I have an MDI container with a toolbar docked on the top. Inside this
MDI I have my child form. With standard behavior, when I'll click on
maximize, the child form will be maximized but the Title Bar of my
child form will go between the title bar of MDI and the ToolBar Docked
on the top of MDI. This is horrible to see for me and final users. In
addition all other child form that will open, will be maximized, also
if for default the maximize button is disable on their properties.
I don't need this. So I modified a little bit the behavior of maximixe
button, to adapt my child form, to MDI maximum usable space. With this
operation, my child will seems maximized, but its title bar remain on
its top and all other child that will be open mantain their original
ratio and position.
The user of this app, agree with me from this point of view.
The only thing that miss to my "Little Bit Modified Maximize" is to
change the Maximize Button to Restore Button after maximized to return
the child form to its original size. From here was born my request on
this Newsgroup.

I hope that it's clear.

In any way many thanks for your helps.

Bye Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top