After I created a listview control, and placed all I need in side, how can I reverse the order of the content?
Is there a special message I could send to it?
Thanks
This is a discussion on Sorting... within the Windows Programming forums, part of the Platform Specific Boards category; After I created a listview control, and placed all I need in side, how can I reverse the order of ...
After I created a listview control, and placed all I need in side, how can I reverse the order of the content?
Is there a special message I could send to it?
Thanks
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Just send the LB_PLEASE_SWAP_SORT_ORDER message.![]()
Honestly though, you have to either sort your strings manually, send LB_RESETCONTENT to clear the box, and then send the strings again in the order you want, which - BTW - is a straightforward matter, OR you can reset the content, resend the strings unsorted, and then mess with the WM_COMPAREITEM message, which == big headache.
Choose your weapon.
Code:int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000 <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000 )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 0;}
You could use a combination of ListView_GetItem() and ListView_SetItem(). The iItem member of the LVITEM structure refers to the index of the item within the list view.
With this in mind, you'd iterate through all items, obtain each item's LVITEM structure, manipulate the index, and upload the modified structure to the list view.
"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C
thank you
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.