forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


API to scroll list without selecting new items?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up
View previous topic :: View next topic  
Author Message
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Mon Oct 27, 2003 6:37 pm    Post subject: API to scroll list without selecting new items? Reply with quote

I have a program that adds items to a visible list at a regular interval and I have set it to select the last item if the list item count exceeds a certain number. This effectively scrolls the list as new items are added. I am curious if there is a way to accomplish the same thing without selecting the last item in the list using API or a Windows message.

Here is the code I'm using...
Code:
%i = @COUNT(LIST1)
IF @GREATER(%i,10)
  LIST SEEK,LIST1,@PRED(%i)
END

_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Mon Oct 27, 2003 6:59 pm    Post subject: Reply with quote

LB_GETCOUNT

wParam = 0; // not used; must be zero
lParam = 0; // not used; must be zero

AND

LB_INSERTSTRING

wParam = (WPARAM) index; // item index
lParam = (LPARAM) (LPCTSTR) lpsz; // address of string to insert


An application sends an LB_INSERTSTRING message to insert a string into a list box. Unlike the LB_ADDSTRING message, the LB_INSERTSTRING message does not cause a list with the LBS_SORT style to be sorted.

Use LB_GETCOUNT to get the number of items (or even VDS)
now U know the last item.
Use LB_INSERTSTRING to add the contents at the last position.

Ofcourse this may move your selected item up as the list grows.
U can get good examples with constant values for both from PGWARE's VDS API Reference.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Mon Oct 27, 2003 7:04 pm    Post subject: Reply with quote

OK I think I have mistaken
You want scroll without select ?

LB_SETTOPINDEX

Code:
%i = @COUNT(LIST1)
IF @GREATER(%i,10)
  %A = @SENDMSG(@WINEXISTS(~LIST1),$197,@PRED(%i),0)
END

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Mon Oct 27, 2003 8:07 pm    Post subject: Reply with quote

THAT is what I was looking for! Thank you CodeScript! Very Happy Very Happy Very Happy
_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up All times are GMT
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 can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group