Здравствуйте! У меня возник вопрос как соединить две функции "WM_NOTIFY" ?
Код:
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
Local $tNMIA = DllStructCreate($tagNMITEMACTIVATE, $lParam)
Local $hTarget = DllStructGetData($tNMIA, 'hWndFrom')
Local $ID = DllStructGetData($tNMIA, 'Code')
Switch $hWnd
Case $hTool
Switch $hTarget
Case $hToolbar
Switch $ID
Case $TBN_GETINFOTIPW
;~ Local $tNMTBGIT = DllStructCreate($tagNMTBGETINFOTIP, $lParam)
Local $tNMTBGIT = DllStructCreate($tagNMHDR & ';ptr Text;int TextMax;int Item;lparam lParam;', $lParam)
Local $Item = DllStructGetData($tNMTBGIT, 'Item')
Local $Text = ''
Switch $Item
Case 10000 ; Button 1
$Text = 'Tooltip 1'
Case 10001 ; Button 2
$Text = 'Tooltip 2'
Case 10002 ; Button 3
$Text = 'Tooltip 3'
Case 10003 ; Button 4
$Text = 'Tooltip 4'
Case 10004 ; Button 5
$Text = 'Tooltip 5'
Case Else
EndSwitch
If $Text Then
DllStructSetData(DllStructCreate('wchar[' & DllStructGetData($tNMTBGIT, 'TextMax') & ']', DllStructGetData($tNMTBGIT, 'Text')), 1, $Text)
EndIf
EndSwitch
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Вот вторая функция.
Код:
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_RCLICK
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$iIndex = DllStructGetData($tInfo, "Index")
If $iIndex <> -1 Then
$iLast_LV_Index = $iIndex
ShowMenu($hWnd, $ContextMenu, $hListView, 1)
EndIf
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc