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.
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.
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.
Ok, got it now, works like a charm that was fast...
:grin:
:grin: