$ Filename "ListView.exe" ' o2
include "RTL32.inc"
include "awinh037.inc"
INT win,wx=0,wy=0,ww=600,wh=400,wstyle = WS_MINMAXSIZE
INT button0,b0ID=100,lvID=1000
win=SetWindow("GUI:ListView",wx,wy,ww,wh,0,wstyle)
'crete button-----------------------------------------------------------------------
button0 = SetButton(win,180,4,80,26,"Close (X)",0x50001000,0x200,b0ID)
'create ListView --------------------------------------------------------------------
INT lvControl = SetListView (win, 20, 60, 300 , 300 ,"ListView", 150, 0, 0x200, lvID)
'------------------------------------------------------------------------------------
Wait() 'message loop
'------------------------------------------------------------------------------------
'func main
Function WndProc (sys hwnd,wmsg,wparam,lparam) as sys callback
SELECT hwnd
CASE win
Select wmsg
CASE WM_CLOSE
CloseWindow(win)
EndProgram
End Select
END SELECT
RETURN Default
END FUNCTION
INT _lvleft,_lvinit,LV_ITEM
% LVM_INSERTCOLUMN = 4123
% LVM_INSERTITEM = 4103
% LVM_SETITEM = 4102
TYPE ListviewColumn
cmask as int
cfmt as int
ccx as int
cpszText as int
ccchTextMax as int
ciSubItem as int
END TYPE
TYPE ListviewItem
mask as int
iItem as int
iSubItem as int
state as int
stateMask as int
pszText as int
cchTextMax as int
iImage as int
lParam as int
END TYPE
DIM LV_COLUMN as ListviewColumn
DIM LV_ITEM as ListviewItem
'create ListView ==============================================================================
Function SetListView (byval lvhwnd as int,byval _lvx as int,byval _lvy as int,byval _lvw as int ,byval _lvh as int,byval lvstring as string,byval lvcwidth as int,byval _lvflag as int,byval _ex as int,byval _cID as INT) As INT
print "F:listView"
If _lvflag=0
_lvflag = 1409351681
End If
hListView = CreateWindowEx(_ex,"SysListView32","",_lvflag,_lvx,_lvy,_lvw,_lvh,lvhwnd,_cID,0,0)
LV_COLUMN.cmask = 7 'LVCF_FMT|LVCF_TEXT|LVCF_WIDTH
LV_COLUMN.cfmt = 0 ' LVCFMT_LEFT
LV_COLUMN.ccx = lvcwidth
LV_COLUMN.cpszText = strptr(lvstring)
LV_COLUMN.ccchTextMax = sizeof(lvstring)+1
'LV_COLUMN.ciSubItem = 0
SendMessage(hListView, LVM_INSERTCOLUMN, 0, LV_COLUMN) ' listview insert column 4123
'GetAsyncKeyState(VK_LBUTTON)
UpdateWindow lvhwnd
Function = hListView
End Function
'-------------------------------------------------------------------------------------
'add list view column {AddLVC hwnd, pos, width , text, flag}
Function AddListViewColumn (byval _lvhandle as int,byval _lvpos as int,byval _lvcwidth as int,byval lvstring as string,byval _lvflag as INT) as INT
LV_COLUMN.cmask = 7
LV_COLUMN.cfmt = 0
LV_COLUMN.ccx =_lvcwidth
LV_COLUMN.cpszText = strptr(lvstring)
SendMessage( _lvhandle, LVM_INSERTCOLUMN,_lvpos,LV_COLUMN)
End Function
'-----------------------------------------------------------------------------------.
'add listview item {AddLVI hwnd, pos, text, icon}
Function AddListViewItem (byval _lvhandle as int,byval _lvpos as int,byval lvstring as string,byval _lvicon as int) as int
INT lvflag
lvflag = 4097 '#LVIF_TEXT|#LVIF_DI_SETITEM
If _lvicon
lvflag = 3 '#LVIF_TEXT|#LVIF_IMAGE
End If
LV_ITEM.mask = lvflag
LV_ITEM.iItem = _lvpos
LV_ITEM.iSubItem = 0
LV_ITEM.pszText = strptr(lvstring)
LV_ITEM.iImage =_lvicon
SendMessage(_lvhandle,LVM_INSERTITEM,0,LV_ITEM) 'list view insert item
End Function
'----------------------------------------------------------------------------------
'add list view sub item
Function AddListViewSubItem (byval _lvhandle as int,byval _lvpos as int,byval _lvsub as int,byval lvstring as string)as INT
LV_ITEM.mask = 4097 '#LVIF_TEXT|#LVIF_DI_SETITEM
LV_ITEM.iItem = _lvpos
LV_ITEM.iSubItem = _lvsub
LV_ITEM.pszText = strptr(lvstring)
SendMessage(_lvhandle, LVM_SETITEM,0,LV_ITEM)
End Function
$ Filename "ListView.exe" ' o2
include "RTL32.inc"
include "awinh037.inc"
INT win,wx=0,wy=0,ww=600,wh=400,wstyle = WS_MINMAXSIZE
INT button0,b0ID=100,listv,lvID=1000, col1,col2
win=SetWindow("GUI:ListView",wx,wy,ww,wh,0,wstyle)
'crete button-----------------------------------------------------------------------
button0 = SetButton(win,180,4,80,26,"Close (X)",0x50001000,0x200,b0ID)
'create ListView --------------------------------------------------------------------
listv = SetListView (win, 20, 60, 300 , 300 ,"COL:0", 150, 0, 0x200, lvID)
'add column
col1= AddListViewColumn (listv, 1, 150, "COL:1" , 0)
'add [0] column items
'add listview item {AddLVI hwnd, pos, text, icon}
AddListViewItem (listv, 0, "item_0", 0)
AddListViewItem (listv, 1, "item_1", 0)
AddListViewItem (listv, 2, "item_2", 0)
AddListViewItem (listv, 3, "item_3", 0)
AddListViewItem (listv, 4, "item_4", 0)
'------------------------------------------------------------------------------------
Wait() 'message loop
'------------------------------------------------------------------------------------
'func main
Function WndProc (sys hwnd,wmsg,wparam,lparam) as sys callback
SELECT hwnd
CASE win
Select wmsg
CASE WM_CLOSE
CloseWindow(win)
EndProgram
End Select
END SELECT
RETURN Default
END FUNCTION
$ Filename "ListView.exe" ' o2
include "RTL32.inc"
include "awinh037.inc"
INT win,wx=200,wy=200,ww=600,wh=420,wstyle = WS_MINMAXSIZE
INT button0,b0ID=100,listv,lvID=1000, col1,col2
win=SetWindow("GUI:ListView",wx,wy,ww,wh,0,wstyle)
'crete button-----------------------------------------------------------------------
button0 = SetButton(win,180,4,80,26,"Close (X)",0x50001000,0x200,b0ID)
'create ListView --------------------------------------------------------------------
listv = SetListView (win, 20, 60, 306 , 300 ,"COL:0", 150, 0, 0x200, lvID)
SendMessage listv, 4150 ,0 , 32 ' extended style - full row select
'add column
col1= AddListViewColumn (listv, 1, 150, "COL:1" , 0)
'add [0] column items
'add listview item {AddLVI hwnd, pos, text, icon}
AddListViewItem (listv, 0, "item_0", 0)
AddListViewItem (listv, 1, "item_1", 0)
AddListViewItem (listv, 2, "item_2", 0)
AddListViewItem (listv, 3, "item_3", 0)
AddListViewItem (listv, 4, "item_4", 0)
'add lv_sub_item
'AddListViewSubItem (lvhandle, lvpos, lvsub , lvstring )
AddListViewSubItem (listv, 0, 1, "sub_item_0")
AddListViewSubItem (listv, 1, 1, "sub_item_1")
AddListViewSubItem (listv, 2, 1, "sub_item_2")
AddListViewSubItem (listv, 3, 1, "sub_item_3")
AddListViewSubItem (listv, 4, 1, "sub_item_4")
'------------------------------------------------------------------------------------
Wait() 'message loop
'------------------------------------------------------------------------------------
'func main
Function WndProc (sys hwnd,wmsg,wparam,lparam) as sys callback
SELECT hwnd
CASE win
Select wmsg
CASE WM_CLOSE
CloseWindow(win)
EndProgram
End Select
END SELECT
RETURN Default
END FUNCTION
but the listview is not editable
Unfortunately I do not know enough about Freebasic to create a DLL of the include file. Would this be possible or has this already been done somewhere? Which steps have to be taken to create a working Dll?