flat assembler
Message board for the users of flat assembler.

Index > Windows > [solved]COMBOBOXINFO

Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 11:47
Code:
.data
        struct COMBOBOXINFO
                cbSize          dd ?
                rcItem          RECT
                rcButton        RECT
                stateButton     dd ?
                hwndCombo       dq ?
                hwndItem        dq ?
                hwndList        dq ?
        ends
        PRESETS_info COMBOBOXINFO sizeof.COMBOBOXINFO
.code
        invoke          GetDlgItem,[hWnd],IDC_PRESETS
        invoke          GetComboBoxInfo,rax,PRESETS_info
    

What is wrong with my COMBOBOXINFO? Is values sizes correct? LastError shows: Invalid access to memory location. First invoke returns handle as requested.


Last edited by Overclick on 27 Aug 2020, 19:34; edited 1 time in total
Post 27 Aug 2020, 11:47
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 27 Aug 2020, 11:50
Yo didn't show all the code so we have to guess you are using 64-bit code? Right?

If so then stateButton being a single dword will unalign all the following values. You could try "stateButton dd ?,?" to make it fill the full qword.
Post 27 Aug 2020, 11:50
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 11:55
Yes it is 64 bit as all present handles is qword. I tried your advice, still the same error.
Post 27 Aug 2020, 11:55
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 12:08
I tried to force the size as 100. Also tried to use struc instead of struct...
Post 27 Aug 2020, 12:08
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 27 Aug 2020, 13:07
And cbSize.

We can't see RECT, so maybe there also.
Post 27 Aug 2020, 13:07
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 13:20
RECT provided by Fasm\INCLUDE\EQUATES\USER64.INC
I tried that value too. Any way, it needs the size only whatever how I manage structure inside. I gived to it 100 bytes will try to give more. I don't use it's names yet. Windows manage it by shifting no matter how I manage parts of it.
Don't you think I have to enable something or SetComboBoxInfo first?..
I need few minutes to return for that search...
Post 27 Aug 2020, 13:20
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1839
Roman 27 Aug 2020, 13:27
Maybe try create window and children combobox window ?


Code:
CreateWindow("combobox", "Cppkdkd", 
                                    WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL,
                                    250, 50, 80, 150, 
                                    hWnd, 0, hInstance, NULL);    


And not get combobox from dialog.


Last edited by Roman on 27 Aug 2020, 13:29; edited 1 time in total
Post 27 Aug 2020, 13:27
View user's profile Send private message 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 27 Aug 2020, 13:29
If you showed some code people can run then they might be able to help you better. We have to take your word that it is the stuct above causing the problem, but perhaps the problem is somewhere else.
Post 27 Aug 2020, 13:29
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 13:45
My code about 62 kbytes. You can use some dialog template to test it. I was hoping the problem would be immediately apparent...
Post 27 Aug 2020, 13:45
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 27 Aug 2020, 13:50
Don't post all your code. Just a minimal example showing the problem.
Post 27 Aug 2020, 13:50
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 13:51
So I did ))
Post 27 Aug 2020, 13:51
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 27 Aug 2020, 13:52
Overclick wrote:
So I did ))
You posted something we can't compile.
Post 27 Aug 2020, 13:52
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1839
Roman 27 Aug 2020, 14:14
Quote:

So I did ))

Congratulation Smile
You do super combo to win api !
Post 27 Aug 2020, 14:14
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 14:19
There is an other way to do the same by CB_GETCOMBOBOXINFO. I'll check if it returns anything.
Post 27 Aug 2020, 14:19
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 803
Location: Russian Federation, Sochi
ProMiNick 27 Aug 2020, 14:32
Such tasks I usualy solve by looking for prey program that already use needed imports. In current case imports should have GetComboBoxInfo, disasm it and analize what structure contents are passed to it, maybe analize code around it and get knowledge about offsets of other struct members,
Post 27 Aug 2020, 14:32
View user's profile Send private message Send e-mail Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 15:16
That is all I can see


Description:
Filesize: 2.31 KB
Viewed: 12209 Time(s)

Capture.PNG


Post 27 Aug 2020, 15:16
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Aug 2020, 19:33
Ok...
Function doesn't works at all. But message request is ok Very Happy

Solution:
Code:
.data
        struct COMBOBOXINFO
                cbSize          dd ?
                rcItem          RECT
                rcButton        RECT
                stateButton     dd ?
                hwndCombo       dq ?
                hwndItem        dq ?
                hwndList        dq ?
        ends
        PRESETS_info COMBOBOXINFO sizeof.COMBOBOXINFO
        CB_GETCOMBOBOXINFO      = 0164h
.code
        invoke SendDlgItemMessage,[hWnd],IDC_PRESETS,\
                CB_GETCOMBOBOXINFO,0,PRESETS_info    
Post 27 Aug 2020, 19:33
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1839
Roman 30 Aug 2020, 04:47
Maybe using dialogbox, try create separately combobox window(let say hwndCombo1) !
And work with hwndCombo1.
Plus hwndCombo1 work parallel to DialogBox !
And easy to do tricks(show\hidden\change font and size\apply or delet names) with hwndCombo1 window.
And you might create combobox list !
https://lh3.googleusercontent.com/proxy/nlav8u8JUMd5uB-2xY78R_4PZzH5HgW8gLdgnt37SpDEGpcwYTjPX_uxhpsdIcr9ypp7IM0Cic3z2GkOJg

https://www.sourcecodester.com/sites/default/files/untitled-1_7.png

invoke SendMessage,[hwndCombo1],WM_GETTEXT,50,ReciveTxtBuffer

50 means get 50 symbols from hwndCombo1

SendTxtBuffer db 'Send this text to combobox and quikly !',0
invoke SendMessage,[hwndCombo1],WM_SETTEXT,0,SendTxtBuffer
Post 30 Aug 2020, 04:47
View user's profile Send private message 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.