flat assembler
Message board for the users of flat assembler.

Index > Windows > [solved] How to create tree view list?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
AsmGuru62



Joined: 28 Jan 2004
Posts: 1708
Location: Toronto, Canada
AsmGuru62 12 Nov 2024, 16:37
Are you using 32-bit code or 64-bit?
Post 12 Nov 2024, 16:37
View user's profile Send private message Send e-mail Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4224
Location: vpcmpistri
bitRAKE 12 Nov 2024, 16:38
[64-bit] If it is other than,
Code:
        mov eax, [r9 + NMTREEVIEW.hdr.code]    
... then perhaps your definition for the NMTREEVIEW structure is incorrect. All the notification data consists of offsets from R9 (lParam).

* NM_TREEVIEW is old naming convention, but applies the same.

[32-bit] The value of lParam is on the stack. Load it into a register and then the above applies - offset from register.
Code:
        mov edx, [esp + 4*4]
        mov eax, [edx + NMTREEVIEW.hdr.code]    
...we can see many examples - to verify our understanding.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 12 Nov 2024, 16:38
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1934
Roman 13 Nov 2024, 09:02
https://rutube.ru/video/93213b5c66d4a6a108cd513803e8579b/

Code:
macro Msg txt {invoke MessageBox,0,txt,0,0}

tvi             TV_ITEM
treeHwnd dd 0
treeNumItems dd 0
Status rb 1024*20
GetTreeAllNames:
        invoke GetDlgItem,esi,1 ;mov esi,[hwnddlg]
        mov [treeHwnd],eax
        invoke SendMessage,eax,TVM_GETCOUNT,0,0
        inc eax
        mov [treeNumItems],eax
;cinvoke sprintf,Status+1000,'%d',eax
;Msg Status+1000

        mov [tvi.cChildren], 0
        mov edi,Status
        mov [tvi.mask],TVIF_TEXT
        mov [tvi.cchTextMax], maxTxtLenn 
        mov [tvi.pszText],edi

        invoke SendMessage,[treeHwnd],TVM_GETNEXTITEM,TVGN_ROOT,0  ;get first tree element
.uu:    mov [tvi.hItem],eax
        invoke SendMessage,[treeHwnd],TVM_GETITEMA, 0, tvi
;dec [treeNumItems]
;jz  .ll
        Msg edi

;get childrns
        mov ebx, [tvi.hItem]
.nnx:
        mov [tvi.mask],TVIF_TEXT+TVIF_CHILDREN
        invoke SendMessage,[treeHwnd],TVM_GETNEXTITEM,TVGN_CHILD,[tvi.hItem]
        mov [tvi.hItem],eax
        test eax,eax
        jz .done
.10:
        invoke SendMessage,[treeHwnd],TVM_GETITEMA, 0, tvi
        dec [treeNumItems]
        jz  .ll
        cmp [tvi.cChildren],1
        jnz .oo
        Msg edi
        jmp .nnx
.oo:
        push eax
        Msg edi
        mov word [edi],0
        invoke SendMessage,[treeHwnd],TVM_GETNEXTITEM,TVGN_NEXT,[tvi.hItem]
        mov [tvi.hItem],eax
        pop eax
        test eax,eax
        jnz .10
.done:
        mov [tvi.mask],TVIF_TEXT
        mov     [tvi.cChildren], 0
        mov [tvi.hItem],ebx
        invoke SendMessage,[treeHwnd],TVM_GETNEXTITEM,TVGN_NEXT,[tvi.hItem]
        test eax,eax
        jnz  .uu
.ll:
        
        ret
    
Post 13 Nov 2024, 09:02
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.