► Afficher le texte
Code : Tout sélectionner
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiTab.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
$Debug_TAB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work
Global $hTab
_Main()
Func _Main()
Local $hGUI
; Create GUI
$hGUI = GUICreate("(UDF Created) Tab Control Create", 400, 300)
$hTab = _GUICtrlTab_Create($hGUI, 2, 2, 396, 296)
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
; Add tabs
_GUICtrlTab_InsertItem($hTab, 0, "Tab 1")
_GUICtrlTab_InsertItem($hTab, 1, "Tab 2")
_GUICtrlTab_InsertItem($hTab, 2, "Tab 3")
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTab
$hWndTab = $hTab
If Not IsHWnd($hTab) Then $hWndTab = GUICtrlGetHandle($hTab)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndTab
Switch $iCode
Case $NM_CLICK ; The user has clicked the left mouse button within the control
_DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; The return value is ignored by the tab control
Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
_DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
;~ Return 1 ; nonzero to not allow the default processing
Return 0 ; zero to allow the default processing
Case $NM_RCLICK ; The user has clicked the right mouse button within the control
_DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
;~ Return 1 ; nonzero to not allow the default processing
Return 0 ; zero to allow the default processing
Case $NM_RDBLCLK ; The user has clicked the right mouse button within the control
_DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
;~ Return 1 ; nonzero to not allow the default processing
Return 0 ; zero to allow the default processing
Case $NM_RELEASEDCAPTURE ; control is releasing mouse capture
_DebugPrint("$NM_RELEASEDCAPTURE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; No return value
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
"!===========================================================" & @LF & _
"+======================================================" & @LF & _
"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
"+======================================================" & @LF)
EndFunc ;==>_DebugPrint
Help!
Hilfe!
A l'aide!



