Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List Box items
#1
How to get the list of items in a list box and pop up in a message box
#2
Examples

ListBox control in QM Find dialog
Code:
Copy      Help
Acc a=acc("" "LIST" "Find" "ListBox" "" 0x1000)
for a.elem 1 1000000000
,str s=a.Name; err break
,out s

SysListView32 control in QM My Macros dialog
Code:
Copy      Help
Acc a=acc("" "LIST" "My Macros" "SysListView32" "" 0x1000)
for a.elem 1 1000000000
,str s=a.Name; err break
,out s

ComboBox control in QM Options dialog (Fonts)
Code:
Copy      Help
int hwnd=child(1003 "" "ComboBox" "Options" 0x5)
int i n=control.CB_GetCount(hwnd)
for i 0 n
,str s
,control.CB_GetItemText(hwnd i s)
,out s

ComboBox controls often are populated only on drop-down event.
#3
Hi,

I want to verify a item in a list box is present or not....
can i use the array concept like getting the total list of items from the list box and storing it in an array any then checking whether that item is present or not....


Gintaras Wrote:Examples

ListBox control in QM Find dialog
Code:
Copy      Help
Acc a=acc("" "LIST" "Find" "ListBox" "" 0x1000)
for a.elem 1 1000000000
,str s=a.Name; err break
,out s

SysListView32 control in QM My Macros dialog
Code:
Copy      Help
Acc a=acc("" "LIST" "My Macros" "SysListView32" "" 0x1000)
for a.elem 1 1000000000
,str s=a.Name; err break
,out s

ComboBox control in QM Options dialog (Fonts)
Code:
Copy      Help
int hwnd=child(1003 "" "ComboBox" "Options" 0x5)
int i n=control.CB_GetCount(hwnd)
for i 0 n
,str s
,control.CB_GetItemText(hwnd i s)
,out s

ComboBox controls often are populated only on drop-down event.
#4
Use LB_FindItem. It returns item index or -1 if not found.

Code:
Copy      Help
int i=control.LB_FindItem(id(1128 "Find") "Macro194t" 0 1)
if(i>=0)
,out "exists"


Forum Jump:


Users browsing this thread: 1 Guest(s)