flat assembler
Message board for the users of flat assembler.

Index > Windows > ListBox control: number of items

Author
Thread Post new topic Reply to topic
BXM



Joined: 03 Nov 2005
Posts: 26
Location: mars
BXM 08 Nov 2005, 14:07
Hi, a simple question.

Pass LB_GETCOUNT as parameter to the control, ok. But then, what is in eax at this point? What variables have to be declared? Is there any conversion to do in order to show the number with say a messagebox?
What about exceptions handling if the list is empty?

Code:
        invoke  SendDlgItemMessage, [hwnd],ID_LISTBOX,LB_GETCOUNT,0,0          
        ;mov     itmcount,eax
        invoke  MessageBox,0,itmcount,msgboxtitle,MB_OK+MB_ICONINFORMATION    

Thanks in advance.
Post 08 Nov 2005, 14:07
View user's profile Send private message Reply with quote
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 08 Nov 2005, 14:28
Try this:

Code:

 buf  rb  32
 stFormat  db "%u",0

 invoke  SendDlgItemMessage, [hwnd],ID_LISTBOX,LB_GETCOUNT,0,0           
 cinvoke wsprintf,buf,stFormat,eax
 invoke  MessageBox,0,buf,msgboxtitle,MB_OK+MB_ICONINFORMATION

    


Regards

_________________
Flat Assembler is the best!
Post 08 Nov 2005, 14:28
View user's profile Send private message Reply with quote
BXM



Joined: 03 Nov 2005
Posts: 26
Location: mars
BXM 08 Nov 2005, 15:16
Thank you IronFelix.
Post 08 Nov 2005, 15:16
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.