Jump to content

Tooltips per listview item


Recommended Posts

I'm trying to get tooltips per listview item. On the MSDN site I found C++ examples that I've tried to convert to AutoIt3. I have very little idea what I am doing when it comes to DLL* functions. Nor any clue as to how to get them working properly or debug them.

This is the code I have so far:

Global Const $LVM_SETINFOTIP = ($LVM_FIRST + 173)
Func _GUICtrlListViewSetItemTooltip($h_listview, $i_index, $s_infotip_text)
;~         UINT cbSize;
;~         DWORD dwFlags;
;~         LPWSTR pszText;
;~         int iItem;
;~         int iSubItem;
;~         HBITMAP hbmp;
;~  $str            = 
    $str_infotip    = DllStructCreate("UINT;DWORD;ptr;int;int;")
    $sp             = DllStructCreate("char[4096]")
    DllStructSetData($sp, 1, $s_infotip_text)
    DllStructSetData($str_infotip, 2, 0)
    DllStructSetData($str_infotip, 3, DllStructGetPtr($sp))
    DllStructSetData($str_infotip, 4, 0);$i_index)
    DllStructSetData($str_infotip, 5, 0)
    DllStructSetData($str_infotip, 1, DllStructGetSize($str_infotip))

    If IsHWnd($h_listview) Then
        Local $a_ret = DllCall("user32.dll", "int", "SendMessage", "hwnd", $h_listview, "int", $LVM_SETINFOTIP, "int", 0, "ptr", DllStructGetPtr($str_infotip))
        Return $a_ret[0]
    Else
        Return GUICtrlSendMsg($h_listview, $LVM_SETINFOTIP, 0, DllStructGetPtr($str_infotip))
    EndIf
EndFunc

I could really use some help with this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...