|
Компьютерный форум OSzone.net » Программирование, базы данных и автоматизация действий » AutoIt » [решено] отловить двойной клик по GuiCtrlCreateList |
|
[решено] отловить двойной клик по GuiCtrlCreateList
|
![]() Старожил Сообщения: 398 |
Здравствуйте!
Вобщем такой вопросик возник. Как из этого: #include <GuiConstantsEx.au3> #include <AVIConstants.au3> #include <TreeViewConstants.au3> ; GUI GuiCreate("Sample GUI", 400, 400) ; LIST $ggg = GuiCtrlCreateList("", 5, 190, 100, 90) GuiCtrlSetData(-1, "a.Sample|b.List|c.Control|d.Here", "b.List") GuiCtrlSetData(-1, "") GuiCtrlSetData(-1, "аенгеаг.Sample|b.List", "b.List") ; GUI MESSAGE LOOP GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $ggg Then $gggg = GUICtrlRead($ggg) MsgBox(0, "", $gggg) EndIf WEnd |
|
------- Отправлено: 20:33, 04-04-2009 |
![]() Старожил Сообщения: 398
|
Профиль | Сайт | Отправить PM | Цитировать Скажите пожалуйста, а как отловить тот же двойной клик только по GUICtrlCreateListView?
|
------- Отправлено: 23:21, 28-04-2009 | #11 |
Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети. Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля. |
Must AutoIt Сообщения: 3054
|
Профиль | Сайт | Отправить PM | Цитировать Цитата morgan1991:
#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> ; Global $iDouble_Click_Event = 0 $hGUI = GUICreate("(Internal) ListView Get Item Text", 400, 300) $nListView = GUICtrlCreateListView("Items", 2, 2, 394, 268) GUICtrlCreateListViewItem("Item 1", $nListView) GUICtrlCreateListViewItem("Item 2", $nListView) GUICtrlCreateListViewItem("Item 3", $nListView) _GUICtrlListView_SetColumnWidth($nListView, 0, 100) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While GUIGetMsg() <> $GUI_EVENT_CLOSE If $iDouble_Click_Event Then $iDouble_Click_Event = 0 MsgBox(64, 'Title', 'Double click (main m.button) event recieved.') EndIf WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $nListView If Not IsHWnd($nListView) Then $hWndListView = GUICtrlGetHandle($nListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_BEGINDRAG; A drag-and-drop operation involving the left mouse button is being initiated Case $LVN_BEGINLABELEDIT; Start of label editing for an item Return False; Allow the user to edit the label ;Return True; Prevent the user from editing the label Case $LVN_BEGINSCROLL; A scrolling operation starts, Minium OS WinXP Case $LVN_COLUMNCLICK; A column was clicked Case $LVN_DELETEALLITEMS; All items in the control are about to be deleted Return True; To suppress subsequent $LVN_DELETEITEM messages ;Return False; To receive subsequent $LVN_DELETEITEM messages Case $LVN_DELETEITEM; An item is about to be deleted Case $LVN_ENDLABELEDIT; The end of label editing for an item ; If Text is not empty, return True to set the item's label to the edited text, return false to reject it ; If Text is empty the return value is ignored Return True Case $LVN_ENDSCROLL; A scrolling operation ends, Minium OS WinXP Case $LVN_GETDISPINFO; Provide information needed to display or sort a list-view item Case $LVN_GETINFOTIP; Sent by a large icon view list-view control that has the $LVS_EX_INFOTIP extended style Case $LVN_HOTTRACK; Sent by a list-view control when the user moves the mouse over an item Return 0; allow the list view to perform its normal track select processing. ;Return 1; the item will not be selected. Case $LVN_INSERTITEM; A new item was inserted Case $LVN_ITEMACTIVATE; Sent by a list-view control when the user activates an item Return 1 Case $LVN_ITEMCHANGED; An item has changed Case $LVN_ITEMCHANGING; An item is changing ;Return True; prevent the change ;Return False; allow the change Case $LVN_KEYDOWN; A key has been pressed Case $LVN_MARQUEEBEGIN; A bounding box (marquee) selection has begun Return 0; accept the message ;Return 1; quit the bounding box selection Case $LVN_SETDISPINFO; Update the information it maintains for an item Case $NM_CLICK; Sent by a list-view control when the user clicks an item with the left mouse button Case $NM_DBLCLK; Sent by a list-view control when the user double-clicks an item with the left mouse button _DebugPrint("Double click (main m.button) event recieved.") $iDouble_Click_Event = 1 Case $NM_HOVER; Sent by a list-view control when the mouse hovers over an item Return 0; process the hover normally ;Return 1; prevent the hover from being processed Case $NM_KILLFOCUS; The control has lost the input focus Case $NM_RCLICK; Sent by a list-view control when the user clicks an item with the right mouse button ;Return 1; not to allow the default processing ;Return 0; allow the default processing Case $NM_RDBLCLK; Sent by a list-view control when the user double-clicks an item with the right mouse button _DebugPrint("Double click (secondary m.button) event recieved.") Case $NM_RETURN; The control has the input focus and that the user has pressed the ENTER key Case $NM_SETFOCUS; The control has received the input focus EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Func _DebugPrint($s_text, $line = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @LF & _ "+======================================================" & @LF & _ "--> Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _ "+======================================================" & @LF) EndFunc |
|
------- Отправлено: 01:44, 29-04-2009 | #12 |
![]() |
Участник сейчас на форуме |
![]() |
Участник вне форума |
![]() |
Автор темы |
![]() |
Сообщение прикреплено |
| |||||
Название темы | Автор | Информация о форуме | Ответов | Последнее сообщение | |
[решено] Отловить форму в IE | Lodoss | AutoIt | 3 | 26-11-2009 11:12 | |
[решено] Отловить visible text | Frost_Imp | AutoIt | 7 | 25-09-2009 12:55 | |
Как сделать двойной клик на объекте, без мышки? | Twix1124 | AutoIt | 2 | 26-07-2009 21:48 | |
[решено] Отловить нажатие по плюсику | morgan1991 | AutoIt | 6 | 30-06-2009 10:54 | |
Ошибка - [решено] Двойной клик на папку открывает поиск | Vahe | Microsoft Windows 2000/XP | 2 | 25-01-2009 18:35 |
|