News:

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

getting text from a ComboBox Edit

Started by DC, February 14, 2006, 03:12:14 AM

Previous topic - Next topic

DC

My ComboBox is with editable Edit, on OK I want to copy the text if it got changed... I get all the right signals in all the right places but can't copy the text?
this is all I can find to do and it doesn't work:
                    invoke  SendMessage, hCombo, CB_SETEDITSEL, 0, -1
                    invoke  OpenClipboard, hCombo
                    invoke  SendMessage, hCombo, WM_COPY , 0, 0
                    invoke  GetClipboardData, CF_TEXT
                    invoke  MessageBox,NULL,eax,eax,MB_DEFBUTTON1
                    invoke  CloseClipboard

any hope for me?
thanx,
DC
this isn't daja vu, I'm just learning it for the 37th time
http://www.bmath.net

DC

I got it with this:
                    mov     ax, -1
                    shl     eax, 16
                    mov     ax, 0
                    invoke  SendMessage, hCombo, CB_SETEDITSEL, 0, eax
                    invoke  SendMessage, hCombo, WM_COPY , 0, 0
                    invoke  OpenClipboard, hCombo
                    invoke  GetClipboardData, CF_TEXT
                    invoke  MessageBox,NULL,eax,eax,MB_DEFBUTTON1
                    invoke  CloseClipboard

it seems like it should be more straight forward tho??
this isn't daja vu, I'm just learning it for the 37th time
http://www.bmath.net

arafel

try

invoke  SendMessage, hCombo, WM_GETTEXT, sizeof somebuffer, ADDR somebuffer
invoke  MessageBox,NULL,ADDR somebuffer,0,MB_DEFBUTTON1

DC

thanx arafel,
sometimes it aint so straight forward, well that solution was, but knowing you could use WM_ messages instead of CB_ messages wasn't
later,
DC
this isn't daja vu, I'm just learning it for the 37th time
http://www.bmath.net