Link to home
Start Free TrialLog in
Avatar of diver999
diver999

asked on

Making a Custom Caption Bar

I need to make the caption bar on my main form wider to make it stand out from other forms/frames on the screen.
Also I need to put a bitmap or glyph logo on the left side of the bar.

I have been reading questions that involve the use of system metrics.  Is this the best way to go ?  What are the index values for system metrics ?  Can you set them in the same way ?

Or any other ideas ...

Any help appreciated

Thanks
Richard
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

hello diver999 , drawing your own caption bar on a non-caption window is not so easy, and there are several factors you may need to code for. .
There is code at this EE question, that does a custom painted caption bar -


https://www.experts-exchange.com/questions/20462056/How-to-create-a-form-that-likes-Outlook2000's-notepaper-window-a-yellow-backcolor-window.html

you might look at this and get some ideas about how to do it. .

this seems to give you a caption heught mesurement -

captionHeight := GetSystemMetrics(SM_CYCAPTION);
Avatar of Bart_Thomas
Bart_Thomas

Check: http://www.g32.org/vcl/index.html 
There's an example how to create your own "toolbar".
and, as a note, that was done before the XP Theme and it's new caption look,
Avatar of diver999

ASKER

Where can I fiind the meanings and index constants for SystemMetrics ?
Is there a similar command for setting the parameters ?

R
???
I guess you mean the index constants for "GetSystemMetrics" ?
not sure how to answer? The GetSystemMetrics( ) function is a windows API function, which is in the Delphi windows.pas unit. .
For basic usage information for the windows API methods and structures, I look in the Win32  API  Help that comes with Delphi. . . If you want more recent API information you can use the MSDN web site, the Library is a good place to start  , , at -

http://msdn.microsoft.com/library/default.asp

use the "Search For" to find info, ,

you can see about the GetSystemMetrics function at -

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemmetrics.asp

as for setting some system parameters. . . I do not remember anything for setting that, but you can look at the SystemParametersInfo( ) function at -

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp

But I know from experience, if you change a system paramterer, and your users notice it, they will   LOUDLY   complain about it! ! !


That's some good information...

I am relaxed about complaints because this is for a dedicated application.

I have been able to change things like COLOR_INACTIVETEXT, using SetSysColors.  However, one thing I really want to do is change COLOR_INACTIVECAPTION and COLOR_GRADIENTINACTIVECAPTION but, although I can see the screen refresh, no colour change takes place.

Also, using SPI I can increase the height of the caption bar - but when I do this, it applies to everything.  Do you know if there is there any way of applying it to just one form ???

Thanks for your interest
Richard
I have seen questions here at EE about changing just one form's caption bar (height, color, buttons) and not other forms captions, and in those questions it was the opinion of several, that this is not posible (and I also think that, is NOT posible), but there may be some new XP thing that I do not know about, however, I really doubt it, , , I do not think the system will draw a custom caption for you. . .

as to the SetSysColors not showing, I really am not sure about this, and have no direct experiece with trying to do that,, , , but my thought is - - it may be that you will need to refresh the windows (have them redrawn) to change their color, if this does not work maybe a reboot? I can not remember much about that, I think some changes require a reboot? I may can find something about that, but I don't have much time now to research that, sorry.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial