Jump to content

Need Help In ListView


daywalkereg
 Share

Recommended Posts

#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 |\\/|µ(|-|

Link to comment
Share on other sites

#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
Link to comment
Share on other sites

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.

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...