Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


-TRM-,
Код: Выделить весь код
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>

Global $hListView

GUICreate("WM_NOTIFY Demo", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)

_GUICtrlListView_SetColumnWidth($hListView, 0, 90)
_GUICtrlListView_AddColumn($hListView, "Items", 100)
_GUICtrlListView_AddItem($hListView, "Item 1")
_GUICtrlListView_AddItem($hListView, "Item 2")
_GUICtrlListView_AddItem($hListView, "Item 3")

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
	Local $hWndFrom, $iCode, $tNMHDR, $hWndListView
	
	$hWndListView = $hListView
	
	If Not IsHWnd($hListView) Then
		$hWndListView = GUICtrlGetHandle($hListView)
	EndIf
	
	$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
	
	$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
	$iCode = DllStructGetData($tNMHDR, "Code")
	
	Switch $hWndFrom
		Case $hWndListView
			Switch $iCode
				Case $LVN_ITEMCHANGING; An item is changing
					;Return True; prevent the change
					;Return False; allow the change
					Return 1
				Case $LVN_BEGINDRAG, $LVN_BEGINRDRAG ;A drag-and-drop operation involving the left/right mouse button is being initiated
					Return 1
			EndSwitch
	EndSwitch
	
	Return $GUI_RUNDEFMSG
EndFunc

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community


Отправлено: 02:19, 13-11-2018 | #4