Skip to content

Instantly share code, notes, and snippets.

@TLMcode
Last active December 19, 2015 23:49
Show Gist options
  • Save TLMcode/6037250 to your computer and use it in GitHub Desktop.
Save TLMcode/6037250 to your computer and use it in GitHub Desktop.
EXPAND ZERO WIDTH COLUMNS
; EXPAND ZERO WIDTH COLUMNS
ExpandColumns:
; LVM_GETCOLUMNWIDTH := (LVM_FIRST + 29)
; LVM_FIRST := 0x1000 ; ListView messages
GuiControl, 1:, SizeCol, % Chr((i:=!i) ? 0xFE:0xA8 )
Gui, 99: Add, Text,, Select the items to expland in listview heading.
Gui, 99: Add, ListView, Checked r20 w300 , |Item
Gui, 99: Add, Button, gDoExpand, Expand
Gui, 99: Default
Loop % (LV_Cnt, Cnt:=1) {
SendMessage, 0x1000|29, % A_Index-1, 0,, % "ahk_id " Colored_LV_1
If (A_Index>1)
LV_Add((!ErrorLevel ? "" : "-" ) "Check", "", LV_Items%A_Index%)
, (!ErrorLevel ? ((ZCol%Cnt%:=A_Index), (Zol0:=Cnt++)):"")
}
Gui, 99: Show,, Expand Columns
Return
DoExpand:
Gui, 99: Submit
Loop % Zol0
SendMessage, 0x1000|30, % ZCol%A_Index%, 4,, % "ahk_id " Colored_LV_1
GuiControl, 1:, SizeCol, % Chr((i:=!i) ? 0xFE:0xA8 )
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment