Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto Text - TS Menus Menu Listitem Limit
#11
autotext items are still not displayed

Function autotext_pop_resize
Trigger !v"" "QM_PopupList" /QM     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=TriggerWindow
int hlv=child("" "SysListView32" hwnd)

if 1 ;;replace 0 with 1 if want to change font
,__Font f.Create("Microsoft YaHei Mono" 12) ;;change this
,SendMessage hlv WM_SETFONT f 1

int widthPercent=150 ;;change this

if(GetWinStyle(hlv)&WS_VSCROLL=0) ret

RECT r.left=LVIR_BOUNDS; SendMessage(hlv LVM_GETITEMRECT 0 &r)
int ni=SendMessage(hlv LVM_GETITEMCOUNT 0 0)
if(ni>50) ni=50 ;;limit height to 50 items. Change the value if want.
r.bottom*ni
int y cx addWidth
RECT rm; MonitorFromIndex hwnd 0 rm
GetWinXY hwnd 0 y cx; y=rm.bottom-(y+r.bottom)-10; if(y<0) r.bottom+y
addWidth=MulDiv(cx widthPercent 100)-cx
cx+addWidth
siz cx r.bottom+4 hwnd
siz cx-4 r.bottom hlv
if addWidth
,SendMessage(hlv LVM_SETCOLUMNWIDTH 0 SendMessage(hlv LVM_GETCOLUMNWIDTH 0 0)+addWidth-(addWidth/10))
,SendMessage(hlv LVM_SETCOLUMNWIDTH 1 SendMessage(hlv LVM_GETCOLUMNWIDTH 1 0)+(addWidth/10))

wait 0 -WC hwnd


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)