News:

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

looking for a combobox example/skeleton

Started by iaNac, September 28, 2006, 09:41:17 PM

Previous topic - Next topic

iaNac

Hi - I've figured out how to create and populate a combobox but I'm having trouble reading the selection.  I've searched for an example in this forum and struck out (or overlooked it?).  I'd really like to learn about them in detail.  Can anyone help?

Thanks

modchip

I learned this from a friend...

Assumming that your combobox is called IDC_COMBO;


mov eax, wParam
.if ax==IDC_COMBO
    shr eax, 16 ; monitor selection change
    .if ax==CBN_SELCHANGE
         invoke SendDlgItemMessage, hWin, IDC_COMBO, CB_GETCURSEL, 0, 0
            .if eax==0 ; selected option 1
; do something
    .elseif eax==1 ; selected option 2
; do something

                .
                . etc...
                .

    .endif
    .endif
.endif


Just remember that the counting starts from 0...  hope this helps. :)

iaNac

Thanks for the lead, I've been looking at cb_ messages in windows.inc but not cbn_.

igndenok

yeah, thanks for the lead. now i remember how to use lo and hi order :)

xandaz

   Hey guys. Any ideas on how to make a Combobox accept a Enter key stroke. I'd like it to add the strings as i press enter but i'm a bit lost
   Feel free to reply.
   bye and ty

farrier

It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

xandaz

    Is it really necessary to subclass the edit control? Can't i just process the WM_CHAR/WM_KEYDOWN from the MainWinddowProc? Thanks anyway. You've been helpful.
   Bye form I....

ToutEnMasm

With combobox  and other control ,you need only  sendmessage,Hcombo,.....
WM_GETTEXT  general control
LB_GETTEXT   listbox
CB_GETTEXT combobox
No need of subclass procedure.
you can also have a look here
http://www.masm32.com/board/index.php?topic=5323.0

xandaz

    I've been looking into some examples and it seems i need to get the handle from combo's edit control and subclass it to process CR ( ENTER ) keystrokes.
    Is this correct or is there any other way?
    Bye and bests from X.


RuiLoureiro

Quote from: xandaz on November 18, 2010, 07:55:12 PM
    I've been looking into some examples and it seems i need to get the handle from combo's edit control and subclass it to process CR ( ENTER ) keystrokes.
    Is this correct or is there any other way?
    Bye and bests from X.
               subclass ?
               I did this example, i hope it help you (.zip=.asm, .inc, ...)
               The combo is called form a dialog box not from the main window