Sign in to follow this  
Followers 0
FireFox

[SOLVED] I can't manage to read listview ....

3 posts in this topic

#1 ·  Posted (edited)

Hi,

the topic explain my request, in the following part of my script, I want to read the $listview listview, I've added bebug console...

Ive not deleted RichEdit functions because It could be the problem... link of RichEdit udf : RichEdit

#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

Opt('GuiOnEventMode', 1)
#include <GuiRichEdit.au3>
#include <GuiListView.au3>

$GUI = GUICreate('Skype TM - d3montools', 435, 200, -1, -1, -1, BitOR($WS_EX_APPWINDOW, $WS_EX_TOOLWINDOW))
;~ GUISetOnEvent(-3, '_SkypeH')
GUISetOnEvent(-3, '_Exit')
;~ GUISetBkColor(0xFFFFFF, $GUI)

$display = _GUICtrlRichEdit_CreateInput($GUI, 8, 8, 300, 20, $ES_READONLY)
$listview = _GUICtrlListView_Create($GUI, 'Text Mood|Order', 5, 40, 300, 150)
_GUICtrlListView_SetColumnWidth($listview, 0, 240)
_GUICtrlListView_SetColumnWidth($listview, 1, 45)

GUICtrlCreateButton('New', 375, 65, 50, 20)
GUICtrlSetOnEvent(-1, '_New')

GUICtrlCreateButton('Add', 320, 115, 50, 20)
GUICtrlSetOnEvent(-1, '_Add')

GUICtrlCreateButton('Delete', 375, 115, 50, 20)
GUICtrlCreateButton('Play', 320, 140, 50, 20)
GUICtrlCreateButton('Stop', 375, 140, 50, 20)
GUICtrlCreateButton('Edit', 320, 65, 50, 20)
GUICtrlCreateButton('Up', 320, 90, 50, 20)
GUICtrlCreateButton('Down', 375, 90, 50, 20)
GUICtrlCreateButton('Open', 320, 170, 50, 20)
GUICtrlCreateButton('Save', 375, 170, 50, 20)
GUISetState(@SW_SHOW, $GUI)

Func _New()
    _GUICtrlListView_BeginUpdate($listview)
    _GUICtrlListView_DeleteAllItems($listview)
    _GUICtrlListView_AddItem($listview, 'new TextMood')
    _GUICtrlListView_AddSubItem($listview, 0, '0', 1)
    _GUICtrlListView_EndUpdate($listview)
EndFunc   ;==>_New

Func _Add()
    _GUICtrlListView_BeginUpdate($listview)
    _GUICtrlListView_AddItem($listview, 'new TextMood')
    _GUICtrlListView_AddSubItem($listview, 0, '0', 1)
    _GUICtrlListView_EndUpdate($listview)
EndFunc   ;==>_Add

While 1
    ConsoleWrite(GUICtrlRead($listview) & @CRLF)
    ConsoleWrite(GUICtrlRead(GUICtrlRead($listview)) & @CRLF)
    ConsoleWrite(_GUICtrlListView_GetItem($listview, 0) & @CRLF)
WEnd

Func _Exit()
    Exit
EndFunc

Thanks for anyhelp !

Cheers, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites



Instead of GuiCtrlRead, #Include <GuiListView.au3> and use either _GuiCtrlListView_GetItemTextString or _GuiCtrlListView_GetItemTextArray.

Share this post


Link to post
Share on other sites

@exodius

Thanks ! it works fine :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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  
Followers 0