News:

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

combobox getext

Started by remus2k, February 08, 2008, 06:07:12 PM

Previous topic - Next topic

remus2k

hello

i have a problem i cannot get the text from a combobox

invoke SendMessage,hCombo,CB_GETCURSEL,0,0
invoke SendMessage,hCombo,CB_GETLBTEXT,eax,addr hbuffer
invoke MessageBox,hWnd,addr hbuffer,0,MB_OK

can your help me please

thanks

ToutEnMasm

Hello,
Verify the value of eax
Quote
The return value is the length of the string, in bytes, excluding the terminating null character.
If the index parameter does not specify a valid index, the return value is CB_ERR
The title of the messagebox couldn't be null (error in title)
put the index in edx,not eax
Quote
mov edx,eax
.if edx != CB_ERR
    .if edx != 0   ;NULL chain
         invoke MessageBox,hWnd,addr hbuffer,SADR("Title"),MB_OK
    .else
         invoke MessageBox,hWnd,SADR("Empty String"),SADR("Title"),MB_OK
    .endif
.endif