'Source wurde am 15.07.2007 aus qui MMJ-Quellcodesammlung (Dietmar Horn) dans qui Babyklappe sur XProfan.Com abgelegt:
'Listview erstellen
$I profalt.inc
DEF @GetSysColor(1) !"User32","GetSysColor"
Settruecolor 1
Déclarer CLASSNAME$,LVHandle&,OK&,LVC#,TXT$,Text#,Text&,LVI#,Chosen&
Déclarer Columntext#,Line#,LVITEM#,List_Text#,Line1$,Line2$,Line3$,Style&
Windowstyle 31
Windowtitle "A little ListView"
Fenêtre 0,0-640,440
CLS @getsyscolor(15)
LET OK&=@CREATEBUTTON(%HWND,"OK",10,360,100,30)
LET CLASSNAME$="SysListView32"
Laisser Style&=$40000000+$10000000+$0001+$0200+$8
LET LVHandle&=@Contrôle(CLASSNAME$,»,Style&,20,20,300,300,%HWND,0,%Hinstance)
@sendmessage(LVHandle&,$1036,0,$20+$1)'show lines, sélectionner full row
@sendmessage(LVHandle&,$1036,0,$20+$1+$4)'show checkboxes,show lines, sélectionner full row
Faible LVC#,24
DIM Columntext#,256
String Columntext#,0="Column 1"
Long LVC#,12=Columntext#
Long LVC#,0=$0001+$0002+$0004+$0008
Long LVC#,4=0
Long LVC#,8=100
Long LVC#,20=0
Long LVC#,16=@LEN(@String$(Columntext#,0))+1
@sendmessage(LVHandle&,@ADD($1000,27),1,LVC#)
String Columntext#,0="Column 2"
Long LVC#,12=Columntext#
Long LVC#,0=$0001+$0002+$0004+$0008
Long LVC#,4=0
Long LVC#,8=100
Long LVC#,20=0
Long LVC#,16=@LEN(@String$(Columntext#,0))+1
@sendmessage(LVHandle&,@ADD($1000,27),2,LVC#)
String Columntext#,0="Column 3"
Long LVC#,12=Columntext#
Long LVC#,0=$0001+$0002+$0004+$0008
Long LVC#,4=0
Long LVC#,8=100
Long LVC#,20=0
Long LVC#,16=@LEN(@String$(Columntext#,0))+1
@sendmessage(LVHandle&,@ADD($1000,27),3,LVC#)
Dispose Columntext#
Proc Get_List_Text
Paramètres LV_HANDLE&,List_Index&,ColumnIndex&
Déclarer ERG$
Faible Line#,36
DIM List_Text#,256
CLEAR Line#
long Line#,0=$1
long Line#,8=ColumnIndex&
long Line#,4=List_Index&
long Line#,20=List_Text#
long Line#,24=256
@sendmessage(LV_HANDLE&,$1005,List_Index&,Line#)
Laisser ERG$=@String$(List_Text#,0)
Dispose Line#
Dispose List_Text#
Retour ERG$
ENDPROC
DIM LVI#,36
Faible Columntext#,256
Claire LVI#
String Columntext#,0="Line 1 / Column 1"
Long LVI#,0=$0001
Long LVI#,4=0
Long LVI#,8=0
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string$(Columntext#,0))
@sendmessage(LVHandle&,$1000+7,1,LVI#)
String Columntext#,0="Line 2 / Column 2"
Long LVI#,0=$0001
Long LVI#,4=1
Long LVI#,8=0
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string$(Columntext#,0))
@sendmessage(LVHandle&,$1000+7,1,LVI#)
String Columntext#,0="Line 3 / Column 1"
Long LVI#,0=$0001
Long LVI#,4=2
Long LVI#,8=0
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string$(Columntext#,0))
@sendmessage(LVHandle&,$1000+7,2,LVI#)
String Columntext#,0="Line 1 / Column 3"
Long LVI#,0=$0001
Long LVI#,4=0
Long LVI#,8=2
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string$(Columntext#,0))
@sendmessage(LVHandle&,$1000+46,0,LVI#)
String Columntext#,0="Line 3 / Column 2"
Long LVI#,0=$0001
Long LVI#,4=2
Long LVI#,8=1
Long LVI#,20=Columntext#
Long LVI#,24=@LEN(@string$(Columntext#,0))
@sendmessage(LVHandle&,$1000+46,2,LVI#)
Dispose Columntext#
Dispose LVC#
Dispose LVI#
Tandis que 0=0
IF @getfocus(OK&)
LET Chosen&=@sendmessage(LVHandle&,$100C,-1,2)
LET Chosen&=Chosen&+1
IF Chosen&<>0
Get_List_Text LVHandle&,Chosen&-1,0
LEt Line1$=@$(0)
Get_List_Text LVHandle&,Chosen&-1,1
LEt Line2$=@$(0)
Get_List_Text LVHandle&,Chosen&-1,2
LEt Line3$=@$(0)
@messagebox("Text dans column 1: "+Line1$+"Text dans column 2: "+Line2$+"Text dans column 3: "+Line3$,"Line "+@str$(Chosen&)+" has been chosen!",64)
endif
endif
Wend
'--------------------------------------------------------------------------------
'regards