just me wrote: ↑06 Feb 2020, 13:20
This might do it:
Code: Select all
; ======================================================================================================================
; LV_EX_SetText - Sets the text of the given item or subitem.
; Caution! No error checking!
; ======================================================================================================================
LV_EX_SetText(HLV, Text, Row, Column := 1) {
; LVM_SETITEMTEXTA = 0x102E, LVM_SETITEMTEXTW = 0x1074
Static LVM_SETITEMTEXT := A_IsUnicode ? 0x1074 : 0x102E
Static OffText := 16 + A_PtrSize
LV_EX_LVITEM(LVITEM, 0, Row, Column)
NumPut(&Text, LVITEM, OffText, "UPtr") ; <<<<< changed "Int" to "UPtr"
Return DllCall("SendMessage", "Ptr", HLV, "UInt", LVM_SETITEMTEXT, "Ptr", Row - 1, "Ptr", &LVITEM, "UInt")
}
; ======================================================================================================================
; ======================================================================================================================
; Function for internal use ============================================================================================
; ======================================================================================================================
; ======================================================================================================================
LV_EX_LVITEM(ByRef LVITEM, Mask := 0, Row := 1, Col := 1) {
Static LVITEMSize := 48 + (A_PtrSize * 3)
VarSetCapacity(LVITEM, LVITEMSize, 0)
NumPut(Mask, LVITEM, 0, "UInt"), NumPut(Row - 1, LVITEM, 4, "Int"), NumPut(Col - 1, LVITEM, 8, "Int")
}
Hello,
i'm using autohotkey for everything in Windows PC now a days, but still not as good as you guys, i still consider my self a noob
i know this is an old thread, but instead of raising a new one i thought ill ask here, thanks in advance
(win 7 sp0, Ahk_L 1.1.33.02)
I need LV_EX_SetText and LV_EX_GetItemParam these functions,
both doesn't seems to work for me, while using these two functions (debugging),
1.many times LV_EX_GetItemParam returns 0, but one time it returns 1.
2.many times LV_EX_SetText returns 0, but one time it actually sets listview with a blank value.
3. some times the gui (which is another process) is crashing with below error,
"
Critical Error: Invalid memory read/write.
Line#
360: LV_SortArrow(MLVh, A_EventInfo, SortOr)
361: if (A_EventInfo = 3)
362: SortOrder(SortOrder)
363: }
364: if (A_GuiEvent == "A" || A_GuiEvent == "DoubleClick")
364: {
365: Gosub,Explore
---> 366: Return
367: }
368: Return
371: if (A_GuiEvent = "Normal")
371: {
372: TV_GetText(SelectedItemText, A_EventInfo)
373: if (SelectedItemText = "Copy Path")
373: {
The program is now unstable and will exit.
"
Code: Select all
#Include <LV_EX>
ControlGet, JLVHwnd, Hwnd,, SysListView321, Explorer ahk_class AutoHotkeyGUI
a := LV_EX_GetItemParam(JLVHwnd, 2)
a1 := LV_EX_SetText(JLVHwnd, "Text", 2, 2)
ListVars
windows are visible not hidden, and i tried creating a simple gui, but same things happens