Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Listview Problems

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
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?

PostPosted: Sun Feb 08, 2009 6:11 pm    Post subject: Listview Problems Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sun Feb 08, 2009 6:39 pm    Post subject: Reply with quote

Im not sure how to use it through messages, but it has something to do with SubItems Confused
Back to top
View user's profile Send private message AIM Address MSN Messenger
Spudgy
Newbie cheater
Reputation: 0

Joined: 13 Jan 2009
Posts: 13

PostPosted: Sun Feb 08, 2009 6:45 pm    Post subject: Re: Listview Problems Reply with quote

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
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Feb 08, 2009 6:58 pm    Post subject: Reply with quote

Thanks spudgy Smile
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Feb 08, 2009 8:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites