flat assembler
Message board for the users of flat assembler.

Index > Windows > [solved] NMHDR NMBCDROPDOWN etc

Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 26 Aug 2020, 15:28
Hi
How can I declare and use this structure names if it's address unknown until windows send it by WM_NOTIFY in lParam?
I doing it brytally for now:
Code:
wm_notify:
        mov             eax,[r9+16]                ;   [StrucName.code]
        cmp             eax,BCN_DROPDOWN
        je              bcn_dropdown
        xor             rax,rax
        ret
        bcn_dropdown:
                mov             eax,[r9+8]              ;    [StrucName.idFrom]
                cmp             eax,IDC_Button
...
    

I wish to use declared names as marked in comments


Last edited by Overclick on 26 Aug 2020, 18:11; edited 1 time in total
Post 26 Aug 2020, 15:28
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 26 Aug 2020, 16:59
mov [r9+NMHDR.code]

if the offsets for the structure is not defined, then:
Code:
virtual at 0
NMHDR NMHDR
end virtual    
...will define them. IIRC, the struct macro defines them. It's like they are identity mapped to a structure of their own name at zero.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 26 Aug 2020, 16:59
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 26 Aug 2020, 18:10
Nice thanks
Post 26 Aug 2020, 18:10
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1840
Roman 26 Aug 2020, 18:18
What if struct do like this ? :
Code:
StrucName.code EQU 16
StrucName.idFrom EQU 8
    
Post 26 Aug 2020, 18:18
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 26 Aug 2020, 18:29
Roman, NMHDR is already in fasm includes but why not. I was looking for some universal metod to do it once for all.
Post 26 Aug 2020, 18:29
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 26 Aug 2020, 19:22
Code:
virtual at r9
nmhdr NMHDR
end virtual

mov eax,[nmhdr.code]    
Is also possible, and might reduce confusion when working with several similar structures. It all depends on what you prefer to look at.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 26 Aug 2020, 19:22
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 26 Aug 2020, 19:36
bitRAKE, Will it take current r9 every time? Then it is awesome!
Post 26 Aug 2020, 19:36
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 26 Aug 2020, 22:52
If I have a structure instantiation that uses a fixed register I like to show it in the name to avoid confusion and to help me six months later when I come back to the code.
Code:
virtual at r9
nmhdr@r9 NMHDR
end virtual    
Post 26 Aug 2020, 22:52
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.