WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Listing files into a Listview, the ListView control gets crowded and the scroll gets activated, but I want the list view to SHOW_LAST file that is added.

starzboy
Quote Post


Active Member
***

Group: Members
Posts: 56
Member No.: 2598
Joined: 15-June 06


Hello,

i am using a listviewcontrol to list files into it, as the files get listed the listviewcontrol gets crowded and the scroll gets activated, but i want the list view to SHOW_LAST file that is added.

How do i make this happen ?
PMEmail Poster
Top
ragdog
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 873
Member No.: 5019
Joined: 13-May 07


Hi

Have i unnderstand this correct
your need a function for schow the last entry in the listview?

post your source for better help

greets
PMUsers Website
Top
XeS
Quote Post


Extremely Active Member
******

Group: Members
Posts: 253
Member No.: 15879
Joined: 3-December 08


If you are using "invoke SendMessage,Hwnd,LVM_INSERTITEM,NULL,addr myLVITEM" the return value is -1 for an error and the index of the item if everything is ok.

So you can use "invoke SendMessage,Hwnd,LVM_SETITEMSTATE,index,addr myLVITEM" to focus and select this item.


Example:
CODE
;InsertItem to Listview
;Hwnd -> handle for Listview
invoke SendMessage,Hwnd,LVM_INSERTITEM,NULL,addr myLVITEM

;if you need to preserve previous state
push myLVITEM.imask
push myLVITEM.state
push myLVITEM.stateMask

;Change to our needs
mov myLVITEM.imask,LVIF_STATE
mov myLVITEM.state,LVIS_SELECTED or LVIS_FOCUSED
mov myLVITEM.stateMask,LVIS_SELECTED or LVIS_FOCUSED

;SetItemState to "Selected and Focused" (eax is the index of the item!)
invoke SendMessage,Hwnd,LVM_SETITEMSTATE,eax,addr myLVITEM

pop myLVITEM.imask
pop myLVITEM.state
pop myLVITEM.stateMask


read the "win32 api reference" Downloadfor more information.

Search for "List View Control Messages". I´ve not tested this example but i think it could work.

Or do you want that the listview is autoscrolling to to last inserted entry?

Regards

XeS
PMEmail PosterUsers WebsiteICQ
Top
starzboy
Quote Post


Active Member
***

Group: Members
Posts: 56
Member No.: 2598
Joined: 15-June 06


"Or do you want that the listview is autoscrolling to to last inserted entry?"

hello xes, yes i want that smile.gif
please help
PMEmail Poster
Top
starzboy
Quote Post


Active Member
***

Group: Members
Posts: 56
Member No.: 2598
Joined: 15-June 06


ok, problem solved
LVM_ENSUREVISIBLE.

thanks though
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google