Jump to content
Sign in to follow this  
daywalkereg

Need Help In ListView

Recommended Posts

daywalkereg

#include <GUIConstants.au3>

#include <GuiListView.au3>

$AForm1 = GUICreate("AForm1", 633, 447, 193, 125)

$ListView1 = GUICtrlCreateListView("", 8, 54, 613, 385, BitOR($LVS_SMALLICON,$LVS_EDITLABELS,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_SUBITEMIMAGES,$LVS_EX_TRACKSELECT))

$Button1 = GUICtrlCreateButton("Button1", 264, 10, 75, 25, 0)

GUISetState(@SW_SHOW)

_GUICtrlListViewSetView($ListView1,$LVS_ICON)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

EndSwitch

WEnd

What I Need Is :

When I Press Button1 Add Item To The ListView1 from the computer like "G:\CodeWarrior_Personal_Edition_31.exe" With Its Icon Can 1 Any Help Me ? :)


1 £0\\/3 |-|3® $0 |\\/|µ(|-|

Share this post


Link to post
Share on other sites
Zedna

#include <GUIConstants.au3>
#include <GuiListView.au3>

$AForm1 = GUICreate("AForm1", 633, 447, 193, 125)
$ListView1 = GUICtrlCreateListView("Column1", 8, 54, 613, 385, BitOR($LVS_SMALLICON, $LVS_EDITLABELS, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_SUBITEMIMAGES, $LVS_EX_TRACKSELECT))
$Button1 = GUICtrlCreateButton("Button1", 264, 10, 75, 25, 0)
GUISetState(@SW_SHOW)

_GUICtrlListViewSetView ($ListView1, $LVS_ICON)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button1
            $file_name = "G:\CodeWarrior_Personal_Edition_31.exe"
            GUICtrlCreateListViewItem($file_name, $ListView1)
            GUICtrlSetImage(-1,$file_name)

    EndSwitch
WEnd

Edited by Zedna

Share this post


Link to post
Share on other sites
daywalkereg

Thanx Zedna I Made It But I Still Have Proplem How can show real icons for .txt .doc .jpeg .mp3 etc.


1 £0\\/3 |-|3® $0 |\\/|µ(|-|

Share this post


Link to post
Share on other sites
Zedna

Thanx Zedna I Made It But I Still Have Proplem How can show real icons for .txt .doc .jpeg .mp3 etc.

I think ExtractAssociatedIcon API function is for that. See MSDN

Look at my Log_View project in my signature to see how is similar ExtractIconEx API function called/used and make it in this way for ExtractAssociatedIcon.

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  

×