Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AHK 1.1 Hide individual checkboxes in a TreeView [x32+x64]


  • Please log in to reply
2 replies to this topic
maestrith
  • Members
  • 786 posts
  • Last active: Apr 10 2019 01:28 PM
  • Joined: 17 Sep 2005
#SingleInstance,Force
Gui,+hwndhwnd
Gui,Add,TreeView,w400 h200 Checked
list:=[]
Loop,2 ;not necessary
{
	id:=TV_Add("This option will not have a checkbox")
	TV_Add("This option will have a checkbox")
	list.insert(id) ;insert the id into the array list
}
Gui,Show,,Hide Checkboxes
VarSetCapacity(tvitem,28)
for index,id in list{ ;loop through the array of id numbers
	info:=A_PtrSize=4?{0:8,4:id,12:0xf000}:{0:8,8:id,20:0xf000} ;there are 2 different offsets for x32 and x64.  This will account for both
	for offset,value in info
		NumPut(value,tvitem,offset)
	SendMessage,4415,0,&tvitem,SysTreeView321,ahk_id%hwnd% ;4415 is tvm_setitemw which is tv_first=0x1100 + 63
}
return
GuiClose:
GuiEscape:
ExitApp
return

Feedback is always welcome.



Azevedo
  • Members
  • 179 posts
  • Last active: Nov 04 2015 04:37 PM
  • Joined: 07 Mar 2012

Thanks!!!

Helped me a lot!



maestrith
  • Members
  • 786 posts
  • Last active: Apr 10 2019 01:28 PM
  • Joined: 17 Sep 2005

Thanks!!!

Helped me a lot!

Glad that it helped.