Gillboss Posted June 23, 2008 Share Posted June 23, 2008 (edited) 1. what command for check if user press double click on item at list? 2. and how check if user remark item at list and press delete? thanks Edited June 23, 2008 by Gillboss Link to comment Share on other sites More sharing options...
Kiti Posted June 23, 2008 Share Posted June 23, 2008 1. what command for check if user press double click on item at list?2. and how check if user remark item at list and press delete?thanksYou can check if the mouse is inside the portion of the screen where your button is, AND if _Ispressed("2E"), for delete. For double click there was something in the Examples\GUI or see if _IsPressed("01") within a specified delay of time, use TimerSetInit, and if it's smaller than 500ms then it means it's a double click and do what you want. Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
Zedna Posted June 23, 2008 Share Posted June 23, 2008 Look here at idea Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
rasim Posted June 23, 2008 Share Posted June 23, 2008 GillbossMore detail please, what mean the list? ListBox or ListView? Link to comment Share on other sites More sharing options...
Gillboss Posted June 23, 2008 Author Share Posted June 23, 2008 (edited) i said list, its mean: GUICtrlCreateList edit: expandcollapse popup#include <GuiListView.au3> #include <GUIConstants.au3> $Form1 = GUICreate("Test", 300, 200) $ListView1 = GUICtrlCreateListView("Col1|Col2", 15, 15, 270, 118) GUICtrlCreateListViewItem("R1C1|R1C2", $ListView1) GUICtrlCreateListViewItem("R2C1|R2C2", $ListView1) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events") While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func OnDoubleclick() $row = _GUICtrlListView_GetNextItem($ListView1) ; current selected If $row = -1 Then Return $col1 = _GUICtrlListView_GetItemText($ListView1,$row,0) ConsoleWrite($col1 & @CRLF) EndFunc Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tagNMHDR, $event If $wParam = $ListView1 Then $tagNMHDR = DllStructCreate("int;int;int", $lParam) $event = DllStructGetData($tagNMHDR, 3) If $event = $NM_DBLCLK Then OnDoubleclick() EndIf EndFunc error in line 10.. Edited June 23, 2008 by Gillboss Link to comment Share on other sites More sharing options...
rasim Posted June 23, 2008 Share Posted June 23, 2008 Gillboss i said list, its mean: GUICtrlCreateListSorry, but List (ListBox) and ListView it`s a different controls. Try this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> $Form1 = GUICreate("Test", 300, 200) $ListView1 = GUICtrlCreateListView("Col1|Col2", 15, 15, 270, 118) GUICtrlCreateListViewItem("R1C1|R1C2", $ListView1) GUICtrlCreateListViewItem("R2C1|R2C2", $ListView1) $DelButton = GUICtrlCreateButton("Del", 15, 160, 75, 23) GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events") GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $DelButton _DelItem() EndSelect WEnd Func _DelItem() Local $iIndex = _GUICtrlListView_GetSelectedIndices($ListView1) If $iIndex = "" Then Return False _GUICtrlListView_DeleteItem($ListView1, $iIndex) EndFunc Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) Local $hWndListView, $tNMHDR, $hWndFrom, $iCode, $tInfo, $iItem $hWndListView = $ListView1 If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($ListView1) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_DBLCLK $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) $iItem = DllStructGetData($tInfo, "Item") If $iItem <> -1 Then ConsoleWrite("!> Item: " & $iItem + 1 & " is clicked" & @LF) Case $LVN_DELETEITEM $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) $iItem = DllStructGetData($tInfo, "Item") If $iItem <> -1 Then ConsoleWrite("!> Item: " & $iItem + 1 & " is deleted" & @LF) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc 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