Achilles Posted January 6, 2007 Share Posted January 6, 2007 All right, I've been trying this for quite awhile and haven't managed to get it working... expandcollapse popup#include <GuiConstants.au3> #include <GuiListView.au3> Dim $listview, $Btn_Exit, $msg, $Status, $pos, $current GUICreate("ListView Get Hot Item", 392, 322) $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER)) GUICtrlCreateListViewItem("line1|data1|more1", $listview) GUICtrlCreateListViewItem("line2|data2|more2", $listview) GUICtrlCreateListViewItem("line3|data3|more3", $listview) GUICtrlCreateListViewItem("line4|data4|more4", $listview) GUICtrlCreateListViewItem("line5|data5|more5", $listview) $Btn_Exit = GUICtrlCreateButton("Exit", 150, 260, 70, 30) $Status = GUICtrlCreateLabel("", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) $current = _GUICtrlListViewGetHotItem ($listview) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $GUI_EVENT_PRIMARYDOWN _DoubleClick() EndSelect WEnd Exit Func _DoubleClick() $pos = GuiGetCursorInfo() If $pos[4] = $listview then $firstClick = _GUICtrlListViewGetCurSel($listview) If $firstClick <> - 1 then $secondClick = -2 $time = TimerInit() Do If GuiGetMsg() = $GUI_EVENT_PRIMARYDOWN then If _GuiCtrlListViewGetHotItem($listview) = $firstClick then $secondClick = _GuiCtrlListViewGetHotItem($listview) $time += 500 Endif Endif $pos = GuiGetCursorInfo() Until TimerDiff($time) > 500 or $pos[4] <> $listview If $firstClick = $secondClick then GUICtrlSetData($Status, 'DOUBLE CLICK! ' & $firstCLick) Else GUICtrlSetData($Status, $firstCLick & "|"& $secondCLick) Endif Endif Endif Endfunc It works some of the time but it is not very consistent and I have no idea why... any ideas? My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 6, 2007 Moderators Share Posted January 6, 2007 http://www.autoitscript.com/forum/index.ph...ite=DoubleClick Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Achilles Posted January 6, 2007 Author Share Posted January 6, 2007 http://www.autoitscript.com/forum/index.ph...ite=DoubleClickThanks SmOke_N... I should of searched the forum first... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now