#include-once #include ;Global Const $WM_NOTIFY = 0x004E ;Global Const $NM_FIRST = 0 ;Global Const $NM_CLICK = ($NM_FIRST - 2) ;Global Const $NM_RETURN = ($NM_FIRST - 4) Func _DebugPrint($s_text) $s_text = StringReplace(StringReplace($s_text, @CRLF, @LF), @LF, @LF & "!-->") ConsoleWrite( _ "+===========================================================" & @LF & _ "!-->" & $s_text & @LF & _ "+===========================================================" & @LF & @LF) EndFunc ;==>_DebugPrint ; WM_NOTIFY event handler Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID Local $tagNMHDR, $event, $nmListView, $lResult, $hwndFrom $tagNMHDR = DllStructCreate($NMHDR, $lParam) ;NMHDR (hwndFrom, idFrom, code) If @error Then Return $hwndFrom = DllStructGetData($tagNMHDR, 1) $event = DllStructGetData($tagNMHDR, 3) For $h = 1 To $hl_hwnd[0][0] Switch $hwndFrom Case $hl_hwnd[$h][0] Switch $event Case $NM_CLICK, $NM_RETURN ;---------------------------------------------------------------------------------------------- If $DebugIt Then _DebugPrint ("$NM_CLICK or $NM_RETURN") ;---------------------------------------------------------------------------------------------- Local $tagNMLINK = DllStructCreate($NMLINK, $lParam) ;---------------------------------------------------------------------------------------------- If $DebugIt Then _DebugPrint ( _ "hwndFrom " & @TAB & ":" & DllStructGetData($tagNMLINK, 1) & @CRLF & _ "idFrom " & @TAB & ":" & DllStructGetData($tagNMLINK, 2) & @LF & _ "code " & @TAB & ":" & DllStructGetData($tagNMLINK, 3) & @LF & _ "mask " & @TAB & ":" & DllStructGetData($tagNMLINK, $mask + 3) & @LF & _ "iLink " & @TAB & ":" & DllStructGetData($tagNMLINK, $iLink + 3) & @LF & _ "state " & @TAB & ":" & DllStructGetData($tagNMLINK, $state + 3) & @LF & _ "stateMask " & @TAB & ":" & DllStructGetData($tagNMLINK, $stateMask + 3) & @LF & _ "szID " & @TAB & ":" & DllStructGetData($tagNMLINK, $szID + 3) & @LF & _ "szUrl " & @TAB & ":" & DllStructGetData($tagNMLINK, $szUrl + 3)) ;---------------------------------------------------------------------------------------------- If StringInStr(DllStructGetData($tagNMLINK, 9), "http") Then Run(@ComSpec & ' /c start " " "' & DllStructGetData($tagNMLINK, 9) & '"', "", @SW_HIDE) Return 0 Else Run(@ComSpec & " /c Start " & DllStructGetData($tagNMLINK, 9), "", @SW_HIDE) Return 0 EndIf ;~ Local $index = Int(DllStructGetData($tagNMLINK, $iLink + 3)) ;~ Local $s_LITEM = DllStructCreate($LITEM) ;~ ;---------------------------------------------------------------------------------------------- ;~ If $DebugIt Then ;~ _DebugPrint("$index: " & $index) ;~ $s_LITEM = DllStructCreate($LITEM) ;~ DllStructSetData($s_LITEM, $mask, BitOR($LIF_URL, $LIF_ITEMINDEX, $LIF_STATE, $LIF_ITEMID)) ;~ DllStructSetData($s_LITEM, $iLink, $index) ;~ DllStructSetData($s_LITEM, $stateMask, BitOR($LIS_ENABLED, $LIS_FOCUSED, $LIS_VISITED)) ;~ $lResult = DllCall("user32.dll", "int", "SendMessage", "hwnd", $hl_hwnd[$h][0], "int", $LM_GETITEM, "int", 0, "ptr", DllStructGetPtr($s_LITEM)) ;~ _DebugPrint("$lResult[0]: " & $lResult[0]) ;~ _DebugPrint( _ ;~ "mask " & @TAB & ":" & DllStructGetData($s_LITEM, $mask) & @LF & _ ;~ "iLink " & @TAB & ":" & DllStructGetData($s_LITEM, $iLink) & @LF & _ ;~ "state " & @TAB & ":" & DllStructGetData($s_LITEM, $state) & @LF & _ ;~ "stateMask " & @TAB & ":" & DllStructGetData($s_LITEM, $stateMask) & @LF & _ ;~ "szID " & @TAB & ":" & DllStructGetData($s_LITEM, $szID) & @LF & _ ;~ "szUrl " & @TAB & ":" & DllStructGetData($s_LITEM, $szUrl)) ;~ $s_LITEM = 0 ;~ $s_LITEM = DllStructCreate($LITEM) ;~ EndIf ;~ ;---------------------------------------------------------------------------------------------- ;~ DllStructSetData($s_LITEM, $mask, BitOR($LIF_URL, $LIF_ITEMINDEX, $LIF_STATE, $LIF_ITEMID)) ;~ DllStructSetData($s_LITEM, $iLink, $index) ;~ DllStructSetData($s_LITEM, $stateMask, BitOR($LIS_ENABLED, $LIS_FOCUSED, $LIS_VISITED)) ;~ DllStructSetData($s_LITEM, $szID, DllStructGetData($tagNMLINK, $szID + 3)) ;~ DllStructSetData($s_LITEM, $szUrl, DllStructGetData($tagNMLINK, $szUrl + 3)) ;~ $lResult = DllCall("user32.dll", "int", "SendMessage", "hwnd", $hl_hwnd[$h][0], "int", $LM_SETITEM, "int", 0, "ptr", DllStructGetPtr($s_LITEM)) ;~ ;---------------------------------------------------------------------------------------------- ;~ If $DebugIt Then ;~ _DebugPrint("$lResult[0]: " & $lResult[0]) ;~ _DebugPrint( _ ;~ "mask " & @TAB & ":" & DllStructGetData($s_LITEM, $mask) & @LF & _ ;~ "iLink " & @TAB & ":" & DllStructGetData($s_LITEM, $iLink) & @LF & _ ;~ "state " & @TAB & ":" & DllStructGetData($s_LITEM, $state) & @LF & _ ;~ "stateMask " & @TAB & ":" & DllStructGetData($s_LITEM, $stateMask) & @LF & _ ;~ "szID " & @TAB & ":" & DllStructGetData($s_LITEM, $szID) & @LF & _ ;~ "szUrl " & @TAB & ":" & DllStructGetData($s_LITEM, $szUrl)) ;~ $s_LITEM = 0 ;~ $s_LITEM = DllStructCreate($LITEM) ;~ DllStructSetData($s_LITEM, $mask, BitOR($LIF_URL, $LIF_ITEMINDEX, $LIF_STATE, $LIF_ITEMID)) ;~ DllStructSetData($s_LITEM, $iLink, $index) ;~ DllStructSetData($s_LITEM, $stateMask, BitOR($LIS_ENABLED, $LIS_FOCUSED, $LIS_VISITED)) ;~ $lResult = DllCall("user32.dll", "int", "SendMessage", "hwnd", $hl_hwnd[$h][0], "int", $LM_GETITEM, "int", 0, "ptr", DllStructGetPtr($s_LITEM)) ;~ _DebugPrint("$lResult[0]: " & $lResult[0]) ;~ _DebugPrint( _ ;~ "mask " & @TAB & ":" & DllStructGetData($s_LITEM, $mask) & @LF & _ ;~ "iLink " & @TAB & ":" & DllStructGetData($s_LITEM, $iLink) & @LF & _ ;~ "state " & @TAB & ":" & DllStructGetData($s_LITEM, $state) & @LF & _ ;~ "stateMask " & @TAB & ":" & DllStructGetData($s_LITEM, $stateMask) & @LF & _ ;~ "szID " & @TAB & ":" & DllStructGetData($s_LITEM, $szID) & @LF & _ ;~ "szUrl " & @TAB & ":" & DllStructGetData($s_LITEM, $szUrl)) ;~ EndIf ;---------------------------------------------------------------------------------------------- EndSwitch EndSwitch Next $tagNMHDR = 0 $event = 0 EndFunc ;==>WM_Notify_Events