Code: Select all
#NoEnv
#SingleInstance Force
#Persistent
FileEncoding UTF-8
gui,add,listview,x5 y12 r35 w400 grid NoSortHdr vVLvInfo hwndHLvInfo,time|txt
gui,Show, x300 y200 w410 h650,workgroup
fd1=%A_ScriptDir%\test2.ahk
fd2=%A_ScriptDir%\test3.ahk
FileDelete,%fd2%
FileRead,SText,%fd1%
EText:="HLvInfo=" HLvInfo . "`n" . SText
FileAppend,%EText%,%fd2%
Run,%fd2%
return
GuiExit:
EXIT:
GuiClose:
gui, destroy
ExitApp
return
Code: Select all
#NoEnv
#SingleInstance Force
#Persistent
FileEncoding UTF-8
sendmsg:="ListView_library sendtest"
LVM_Insert(HLvInfo,1,1,0,,A_Hour . ":" . A_min . ":" . A_Sec,sendmsg)
ExitApp
LVM_Insert(hLV, row=0, col=1, options=0, f*) {
col := col ? col-1 : 0
row := row ? row-1 : DllCall("SendMessage", "uint", hLV, "uint", 4100, "uint", 0, "uint", 0)
VarSetCapacity(lvItem, A_PtrSize * 6, 0)
NumPut(9 , lvItem, A_PtrSize * 0 "uint") ; mask
NumPut(row , lvItem, A_PtrSize * 1, "int") ; iItem
NumPut(options, lvItem, A_PtrSize * 3, "uint") ; state
NumPut(1 , lvItem, A_PtrSize * 4, "uint") ; stateMask
DllCall("SendMessage", "uint", hLV, "uint", 4103, "uint", 0, "uint", &lvItem) ; LVM_INSERTITEM
For index,field in f
{
NumPut(col + A_Index - 1, lvItem, A_PtrSize * 2, "int") ; iSubItem
NumPut(&field , lvItem, A_PtrSize * 5, "ptr") ; pszText
DllCall("SendMessage", "uint", hLV, "uint", A_IsUnicode ? 4172 : 4171, "uint", 0, "ptr", &lvItem) ; LVM_SETITEMW
}
}