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
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. :)
Thanks for the lead, I've been looking at cb_ messages in windows.inc but not cbn_.
yeah, thanks for the lead. now i remember how to use lo and hi order :)
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
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
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....
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
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.
xandaz
http://www.masm32.com/board/index.php?topic=15139.0
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