카테고리 없음

오토핫키 트리뷰 추가기능

realnotepad 2024. 8. 28. 14:20
추가기능 소개
  • 그리드 효과 추가
  • 부모-자식간 구분자 직관화
  • 배열을 트리뷰로 시각화 함
  • 선택 행 구분 기능(이펙트 트리거,폰트 색상 변경)

Dll 다운로드

injection.dll
0.30MB

소스코드
Gui, Add, treeView, gclick hwndtv x22 y9 w410 h280 
Gui, Show
Tree.insert(tv,{"부":"아들"},{"모":"딸"})
return

GuiClose:
ExitApp
return

click:
msgbox % Clipboard:=Tree.db_get_treechildren()
return

Class Tree
{
  /*
      제작자 : Notepad
      제작일 : 2024-08-29
  */
db_get_selection()
{
TV_GetText(keyword,TV_GetSelection())
return keyword
}

db_get_treechildren() {
	loop {
	selection:=TV_GetSelection()
	switch a_index
	{
		Case 1: child:=TV_GetParent(selection)
        Default:child:=TV_GetParent(before_child)
	}		
	TV_GetText(ch%a_index%,child)
	if (ch%a_index%=0 || ch%a_index%="") {
		aa_index:=A_Index
		break
	}
	TV_Full:=ch%a_index% "/" TV_Full
	before_child:=child
	}	
		switch aa_index
		{
		case 2:	 return TV_Full ? SubStr(TV_Full, 1, StrLen(TV_Full)-1) "/" this.db_get_selection() :  this.db_get_selection()
		Default: return TV_Full ? SubStr(TV_Full, 1, StrLen(TV_Full)-1) :  this.db_get_selection()
		}
}
  
  Load(obj,keyname:="",subname:="")
  {
    for k,v in obj 
    {
        if (isobject(v))
          (keyname) ?  this.load(v,keyname "[" k "]",TV_Add(k,subname)) :  this.load(v,"[" k "]",TV_Add(k))
        else if(!isobject(v) && keyname="")
        sb:=TV_Add(k),TV_Add(v,sb)
        if(!isobject(v) && keyname){
          tsubname:=TV_Add(k,subname)
          TV_Add(v,tsubname)
        }
    }
  }
  
  Insert(treehandle,data*){
    for k,v in data
      this.Load(v)
    this.mydll(treehandle)
  }

  mydll(hhwnd){
  hModule := DllCall("LoadLibrary", "Str", "injection.dll")
  DllCall("injection.dll\Notepad_CustomTreeView", "Ptr", hhwnd)	
  }
}