Page 1 of 1

Font size in window title bars

Posted: Thu Oct 31, 2019 9:02 pm
by Sparks
Is there a way in LBB to control the font size in window title bars?

Re: Font size in window title bars

Posted: Sat Nov 09, 2019 2:25 pm
by JackKelly
Hello, Sparks. I feel bad that no one has replied to your question. I don't think there's many of us around here anymore. Sad. I don't see anyway either, to control the font size in the title bars in an LBB program. There's probably APIs and DLLs, as is usually the case, but I don't know them. Of course you could use upper-case letters, but that's probably not the solution you're looking for.

In any case, it's good to see that you're still around. You've always been a consistent LBB enthusiast...
Jack

Re: Font size in window title bars

Posted: Mon Nov 11, 2019 6:28 pm
by Sparks
Thanks Jack, I've suspected we're stuck with the small font but thought I'd see if anyone knew of a way. It has been very quiet here lately. Best regards

Re: Font size in window title bars

Posted: Wed Nov 13, 2019 4:04 pm
by net2014
As far as I can ascertain, the option to change titlebar fonts has been removed from win10 settings and I can not find any api method or BBC code either.
If it is of importance to you, there are numerous ways of simulating a titlebar which can use a font and size as required.
This might be of use to you if you have not already sussed it, just use of simple code!

Code: Select all

 'simulate title box with chosen font & close box
nomainwin
  WindowWidth=500
  TextboxColor$="cyan"
  stylebits #main.title, _ES_READONLY,0, 0, _WS_EX_CLIENTEDGE
  textbox #main.title, 0,0,WindowWidth-30,30
  stylebits #main.quit, _BS_FLAT,0,0,0
  button #main.quit, "X", [quit], UL, WindowWidth-30, 0,30,30
  open "Titlebar demo" for window_popup as #main
  #main.title "!disable"
  #main.title "!font Times_New_Roman 16 italic";
  #main.title "Title in chosen font"
  #main.quit "!setfocus"
  wait

  [quit]
  close #main
  end
 

Re: Font size in window title bars

Posted: Wed Nov 13, 2019 5:32 pm
by guest
net2014 wrote: Wed Nov 13, 2019 4:04 pm As far as I can ascertain, the option to change titlebar fonts has been removed from win10 settings and I can not find any api method or BBC code either.
Microsoft rarely remove any API methods; their obsession with 'app compatibility' tends to preclude that. So, although I haven't tried it, I think it's highly likely that the SystemParametersInfo API with the SPI_SETNONCLIENTMETRICS parameter will let you change the titlebar font size, just as it always has. But the crucial thing to realise is that this is a system wide setting; as such it will change the titlebar font in every window, and will accordingly require being Run as Administrator.

I assume that this is not what the OP wants, otherwise I would have replied earlier. There is no way in Windows that you can change the titlebar font in just one window. All you can do in that case is 'fake' it by subclassing the WM_NCPAINT message and drawing the window's non-client area (including the titlebar) yourself. Or (as has already been suggested) simply disable the titlebar completely and draw your own fake titlebar at the top of your window using a GRAPHICBOX.

Richard.