Sign in to follow this  
Followers 0
souldjer777

Best way to copy GuiCtrlListView items text to memory (clipboard)?

5 posts in this topic

Hello Everyone,

FIrst: I Love AutoIT, love absolutely everything about it - thank you all so much! It's the best :)

Second: What is the best way to copy and paste GuiCtrlListView items text to memory (clipboard)? I'm not looking to reinvent the wheel. I'm looking for advice. I have about 8 columns with unknown numbers of rows. I just want to be able to copy and paste what items I select from the GuiCtrlListView. Here is the short of my code... I have an array of data I display - but not all array items... easiest way?

$ListViewSP01 = GUICtrlCreateListView ("TZ|Start|Name|OUT|Function|Comments|Cell|Phone",$LabelGui3Left02, $LabelGui3Top03, $LabelGui3Width03 , $ListViewSP01height, BitOR($LVS_EDITLABELS, $LVS_REPORT))

Local $iExListViewStyle = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_FLATSB, $LVS_EX_HEADERDRAGDROP, $LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES, $LVS_EX_DOUBLEBUFFER, $LVS_EDITLABELS)

_GUICtrlListView_SetExtendedListViewStyle($ListViewSP01, $iExListViewStyle)

For $t02 = 0 To UBound($aGui3SP) - 1
$LabelGui3Number03[$t02] = GUICtrlCreateListViewItem($aGui3SP[$t02][1] & "|" & $aGui3SP[$t02][2] & "|" & $aGui3SP[$t02][3] & "|" & _
$aGui3SP[$t02][4] & "|" & $aGui3SP[$t02][5] & "|" & $aGui3SP[$t02][6] & "|" & $aGui3SP[$t02][7] & "|" & _
$aGui3SP[$t02][8], $ListViewSP01)
Next

GUISetState(@SW_SHOW , $hGUI03)

_GUICtrlListView_RegisterSortCallBack($ListViewSP01)

While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_GUICtrlListView_UnRegisterSortCallBack($ListViewSP01)
                 GUIDelete($hGUI03)
Call ("Enable_Buttons02")
                 ExitLoop
Case $ListViewSP01
             ; Kick off the sort callback
             _GUICtrlListView_SortItems($ListViewSP01, GUICtrlGetState($ListViewSP01))
EndSwitch
WEnd

Thanks everyone!


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites



Please post a working script so we can see what it is you're attempting to do.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi BrewManNH - That's difficult to do since the script array is taken from IE tables which only I have access to. It's private data. The small amount I posted is only part of the 591 lines of AutoIT code. Even the GUI buttons / lists / etc are all generated by the IE table data. So nothing would work on your end. Just looking for best way to copy listview in your opinion. Something like the "ArrayDisplay" function - which has a "Copy to Clipboard" funtion.

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites

Have you looked at the code for the _ArrayDisplay function? If you had, you probably wouldn't have needed to ask how to do it, seeing as the code is already there in the function itself.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Good times. Didn't expect that answer - I'll see what I can do with the built in au3.

:sorcerer:

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

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