Does Windows allow to have a window with both the help button and the min/max buttons?
I want to put help buttons on all my windows, like this:
But when I put the help button in, the minimize/maximize buttons disappear. Does Windows forbid having the min/max buttons together with the help buttons? That would be disappointing because that would mean I could put the help button only on dialogs and not on frames.
If Windows does forbid this, it would be nice to see an official Microsoft document which talks about this policy.
It is not possible through setting windows styles. If you really wanted to you could set some hooks that would probably let you do what you want, but I would not recommend doing that. You can mimic the functionality of the help button by sending the WM_HELP
message.
According to MSDN, the styles WS_MAXIMIZEBOX
and WS_MINIMIZEBOX
can not be combined with WS_EX_CONTEXTHELP
.
Although it is true what daalbert says, with some effort it is indeed possible to draw just about anything properly on the window frame. Of course this is in no way "official" and the limitation that daalbert mentions still stands.
You can listen for WM_NCPAINT
and draw the button yourself with the help of DrawFrameControl
with DFC_BUTTON
(which makes sure it will look like the real thing). Use WM_NCHITTEST
and friends (WM_NC*BUTTON*
) to find out whether the button you draw gets clicked.
So yes, it's technically possible to achieve what you want but usually not worth the extra effort.
Just wanted to have this on record for completeness.
精彩评论