 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Feb 08, 2009 6:11 pm Post subject: Listview Problems |
|
|
I'm using a multi-column listview in an application and I can only seem to add text to my first column. Here's my code:
| Code: |
InsertItem(0, 0, "test", FALSE);
InsertItem(0, 1, "test", FALSE);
InsertItem(0, 2, "test", FALSE);
InsertItem(0, 3, "test", FALSE);
//heres InsertItem()
void InsertItem(int iItem, int iSubItem, LPSTR pszText, BOOL bNotFirst) {
LVITEM lvi;
lvi.mask = LVIF_TEXT;
lvi.iItem = iItem;
lvi.iSubItem = iSubItem;
lvi.pszText = pszText;
if(bNotFirst) {
SendMessage(hListview, LVM_SETITEM, 0, (LPARAM)&lvi);
}
else {
SendMessage(hListview, LVM_INSERTITEM, 0, (LPARAM)&lvi);
}
}
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sun Feb 08, 2009 6:39 pm Post subject: |
|
|
Im not sure how to use it through messages, but it has something to do with SubItems
|
|
| Back to top |
|
 |
Spudgy Newbie cheater
Reputation: 0
Joined: 13 Jan 2009 Posts: 13
|
Posted: Sun Feb 08, 2009 6:45 pm Post subject: Re: Listview Problems |
|
|
| Code: |
int temp = InsertItem(1, 0, "test", FALSE);
InsertItem(temp, 1, "test", TRUE);
InsertItem(temp, 2, "test", TRUE);
InsertItem(temp, 3, "test", TRUE);
//heres InsertItem()
int InsertItem(int iItem, int iSubItem, LPSTR pszText, BOOL bNotFirst) {
LVITEM lvi;
lvi.mask = LVIF_TEXT;
lvi.iItem = iItem;
lvi.iSubItem = iSubItem;
lvi.pszText = pszText;
if(bNotFirst) {
return SendMessage(hListview, LVM_SETITEM, 0, (LPARAM)&lvi);
}
else {
return SendMessage(hListview, LVM_INSERTITEM, 0, (LPARAM)&lvi);
}
}
|
Should work fine now.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Feb 08, 2009 6:58 pm Post subject: |
|
|
Thanks spudgy
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Feb 08, 2009 8:10 pm Post subject: |
|
|
Or just check for iSubItem being higher than 0?
if (iSubItem > 0) ListView_SetItem
else ListView_InsertItem
gets rid of a parameter.
_________________
|
|
| Back to top |
|
 |
|
|
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
|
|