Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Middle Click title bar
#5
I just found this function in my list, but don't remember whether it works well.

Function GetWindowTextWidth:
Code:
Copy      Help
;/
function# hwnd

dll gdi32 #GetTextExtentPoint32 hDC $lpsz cbString SIZE*lpSize

int st=GetWindowLong(hwnd GWL_STYLE)
if(st&WS_CAPTION != WS_CAPTION) ret
str s.getwintext(hwnd); if(!s.len) ret
int dc=GetWindowDC(hwnd)
SIZE si
int r=GetTextExtentPoint32(dc s s.len &si)
ReleaseDC(hwnd dc)
if(r) ret si.cx


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)