News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ComboBox ItemIndex - is it possible MASM?

Started by Stuck_Newb, July 19, 2007, 11:33:59 PM

Previous topic - Next topic

Stuck_Newb

sorry if this is a dumb question, i searched for any ideas and couldnt seem to come up with anything

i have a combo box populated at runtime with X strings, is there anyway to know which string has been chosen by the item index(or as an Int) rather than a compare of the string itself?

please remember im a newb and go gentle  :boohoo:

hutch--

Hi Stuck,

Welcome on board, we have all been stuck from time to time so you are among friends here. A combo box is no big deal after you get the swing of them but we would need to see some of your code to see what you are trying to do. The basics of the older controls is that you code what is called a "subclass" to process messages for the control.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Stuck_Newb

after digging around on the net i found the CB_GETCURSEL command, however it always returns 0 regardless of what has been selected

          .if uMsg == WM_COMMAND
            mov eax,wParam 
            shr eax,16
              .if ax==CBN_SELCHANGE
                  invoke SendMessage,hWnd,CB_GETCURSEL,0,0 ;is always returning 0 regardless?
              .endif


thanks for any help, what im trying to do is simply get to grips with the language and get a feel for the syntax by playing around a little

anon

invoke SendMessage,hWnd,CB_GETCURSEL,0,0
Your code should work IF the value of hWnd is the handle of the ComboBox

Stuck_Newb

Thank you very much - what was throwing me was a piece of code in a function was changing the hWnd

that sound you could hear the past few days was my head hitting the wall  :red