Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Middle Click title bar
#4
how do i get info about the font settings of my current running xp theme ?

like: font name and size applied to window titlebar, button size, etc ?

my idea is to rollup a window and size it to buttons+wintext.

my current script is far from perfect:


Code:
Copy      Help
int hwnd=win(mouse)
def CCHILDREN_TITLEBAR 5
type TITLEBARINFO cbSize RECT'rcTitleBar rgstate[CCHILDREN_TITLEBAR+1]
dll user32 #GetTitleBarInfo hwnd TITLEBARINFO*pti
RECT r; GetWindowRect hwnd &r ;;save

TITLEBARINFO ti.cbSize=sizeof(TITLEBARINFO)
GetTitleBarInfo hwnd &ti

str value
typelib GflAx {059321F1-207A-47A7-93A1-29CDF876FDD3} 1.0
GflAx.GflAx g._create
g.FontSize=8
int width=g.GetTextWidth(_s.getwintext(hwnd))+140
_s=hwnd


int x y rw rh; GetWinXY hwnd x y rw rh
str xy.from(rw "-" rh)
rget(value _s "rollup" HKEY_CURRENT_USER)
str w.gett(value 0 "-");str h.gett(value 1 "-")

if (len(value)=0)
,rset(xy _s "rollup" 0 REG_SZ)
,siz width ti.rcTitleBar.bottom-ti.rcTitleBar.top hwnd 0
else
,rset(xy _s "rollup" 0 -1)
,siz val(w) val(h) hwnd ;;restore
pi


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)