Jump to content
Sign in to follow this  

$LVN_HOTTRACK and adding a pic.

Recommended Posts


using $LVN_HOTTRACK so when i hover over the listview i get the image.....

but it only works for the first 3-4 items in the listview.

can u guys come up with something a bit more efficient please. maybee by loading images to memory.? then calling from memory

Am using both .jpg files and .png

Case $LVN_HOTTRACK; Sent by a list-view control when the user moves the mouse over an item
                    Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)

                    $row = DllStructGetData($tInfo, "Item")
                    If $last = -1 Then GUICtrlSetImage($Pic1, "")
                    If $last <> $row Then
                        $last = $row
                        $list_name=_GUICtrlListView_GetItemText($ListView, $row) 
$list_name=StringReplace($list_name," ","_")
                            for $ln=1 to $flist[0]
                                if StringInStr($flist[$ln],".Jpg")>0 and StringInStr($list_name,$flist[$ln])>0 then
                             $hImage = _GDIPlus_ImageLoadFromFile("C:\foo\"&$list_name&".jpg");png
                             $hImage = _GDIPlus_ImageLoadFromFile("C:\foo\"&$list_name&".png")  
                            Local $hCLSID = _GDIPlus_EncodersGetCLSID("BMP")
                            _GDIPlus_ImageSaveToFileEx($hImage, @ScriptDir & "\test.bmp", $hCLSID)
                            $set=GUICtrlSetImage($Pic1, @ScriptDir & "\test.bmp")
                    ;GUICtrlSetImage($Pic1, "C:\foo\"&$list_name&".Jpg")    
if $set=0 Then GUICtrlSetImage($Pic1, "")

                ;ElseIf _GUICtrlListView_GetItemText($ListView, $row) = "testa" Then
                ;   GUICtrlSetImage($Pic1, "C:\foo\Austere_Hat.Jpg")
Edited by Aceguy

Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.