kxing 发表于 2013-9-2 10:18:49

请教消息拦截函数传入参数的问题

本帖最后由 kxing 于 2013-9-2 10:24 编辑

请问各位大大,像这种消息拦截函数有没办法传入第三个参数呢的
每次要传入控件句柄都得声明为全局变量,这样实在不方便。
感谢高手们回答....
#include <GUIConstantsEx.au3>
#include <StructureConstants.au3>
#include <WindowsConstants.au3>

guicreate("test",200,200)
$hListview=guictrlcreatelistview("listview",0,0,200,200)
guisetstate()
guiregistermsg($WM_NOTIFY,"WM_NOTIFY")

for $i=0 to 10
guictrlcreatelistviewitem("列表项目:"&$i,$hListview)
next


do

until guigetmsg()=-3


func WM_NOTIFY($hWndGUI, $MsgID, $WParam, $LParam)
Local $tagNMHDR, $Event, $hWndFrom, $IDFrom
Local $tagNMHDR = DllStructCreate("int;int;int", $LParam)
If @error Then Return $GUI_RUNDEFMSG
$IDFrom = DllStructGetData($tagNMHDR, 2)
$Event = DllStructGetData($tagNMHDR, 3)
$tagNMHDR = 0
if $IDFrom=$hListview then
if $Event=$NM_CLICK then msgbox(0,'click',guictrlread(guictrlread($hListview)))
endif
Return $GUI_RUNDEFMSG
endfunc   ;==>WM_NOTIFY

kxing 发表于 2013-9-3 18:52:01

有高人帮助下吗,谢谢了...
页: [1]
查看完整版本: 请教消息拦截函数传入参数的问题