Ok, I'm trying to return the number of items in a listbox using the LB_GETCOUNT message, when I do that it returns as a funky square charactor.


Here's a bit of the code:

.data
intItemCount dd 0 ;Listbox item count.

.code
invoke SendMessage,hListbox,LB_GETCOUNT,0,0 ;Get Item Count.
mov intItemCount,eax

push 0
push 0
push offset intItemCount
push 0
call MessageBox ;Display Result.
Posted on 2003-05-25 18:41:49 by Knight Chat X
You have to convert the number to ascii text first. Use dw2a to do that:
.data

intItemCount dd 0 ;Listbox item count.
buffer BYTE 16 DUP(0)

.code
invoke SendMessage,hListbox,LB_GETCOUNT,0,0 ;Get Item Count.
mov intItemCount,eax

invoke dw2a,intItemCount,offset buffer

push 0
push 0
push offset buffer
push 0
call MessageBox ;Display Result.
Posted on 2003-05-25 18:48:02 by donkey
Ok, got it now, works like a charm that was fast...

:grin:
Posted on 2003-05-25 19:51:19 by Knight Chat X