The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: iaNac on September 28, 2006, 09:41:17 PM

Title: looking for a combobox example/skeleton
Post by: iaNac on September 28, 2006, 09:41:17 PM
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
Title: Re: looking for a combobox example/skeleton
Post by: modchip on September 29, 2006, 03:03:54 AM
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. :)
Title: Re: looking for a combobox example/skeleton
Post by: iaNac on September 29, 2006, 03:37:54 AM
Thanks for the lead, I've been looking at cb_ messages in windows.inc but not cbn_.
Title: Re: looking for a combobox example/skeleton
Post by: igndenok on July 01, 2009, 12:22:57 PM
yeah, thanks for the lead. now i remember how to use lo and hi order :)
Title: Re: looking for a combobox example/skeleton
Post by: xandaz on October 07, 2010, 10:54:32 AM
   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
Title: Re: looking for a combobox example/skeleton
Post by: farrier on October 07, 2010, 01:14:49 PM
xandaz,

These may help you:

http://www.masm32.com/board/index.php?topic=12827.0

http://www.masm32.com/board/index.php?topic=2449.0

IsDialogMessage

farrier
Title: Re: looking for a combobox example/skeleton
Post by: xandaz on October 07, 2010, 01:58:42 PM
    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....
Title: Re: looking for a combobox example/skeleton
Post by: ToutEnMasm on October 07, 2010, 03:53:59 PM
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
Title: Re: looking for a combobox example/skeleton
Post by: 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.
Title: Re: looking for a combobox example/skeleton
Post by: Coma on November 18, 2010, 09:54:13 PM
xandaz

http://www.masm32.com/board/index.php?topic=15139.0
Title: Re: looking for a combobox example/skeleton
Post by: RuiLoureiro on November 19, 2010, 05:46:07 PM
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