Ticket #222: GUIRegisterMsg_Regression.au3

File GUIRegisterMsg_Regression.au3, 1.7 KB (added by Ultima, 13 years ago)
Line 
1#include <GUIConstantsEx.au3>
2#include <WindowsConstants.au3>
3#include <TreeViewConstants.au3>
4#include <StructureConstants.au3>
5
6Opt("GUIOnEventMode", 1)
7
8Global $GUIMain_iWidth = 150
9Global $GUIMain_iHeight = 100
10
11; GUI/Controls --------------
12Global $GUIMain = GUICreate(@AutoItVersion, $GUIMain_iWidth, $GUIMain_iHeight)
13
14Global $TreeView = GUICtrlCreateTreeView(5, 5, $GUIMain_iWidth - 10, $GUIMain_iHeight - 10, $TVS_HASBUTTONS + $TVS_HASLINES + $TVS_LINESATROOT + $TVS_NONEVENHEIGHT, $WS_EX_CLIENTEDGE)
15Global $TreeView_hWnd = GUICtrlGetHandle($TreeView)
16
17GUICtrlCreateTreeViewItem("ITEM", $TreeView)
18GUICtrlCreateTreeViewItem("SUBITEM", -1)
19
20; Miscellaneous -------------
21GUISetOnEvent($GUI_EVENT_CLOSE, "mainExit", $GUIMain)
22GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
23GUISetState()
24
25; Main Loop -----------------
26While 1
27    Sleep(1000)
28WEnd
29
30; Functions -----------------
31Func mainExit()
32    Exit
33EndFunc
34
35Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
36    Local $tNMHDR = DLLStructCreate($tagNMHDR, $lParam)
37        If (DllStructGetData($tNMHDR, "hWndFrom") = $TreeView_hWnd) And (DllStructGetData($tNMHDR, "Code") = $NM_DBLCLK) Then
38                Return 1+Chain1()
39        EndIf
40
41    Return $GUI_RUNDEFMSG
42EndFunc
43
44; Callback Function Chain ---
45Func Chain1()
46        For $i = 0 To 10000
47                ConsoleWrite("")
48        Next
49        Chain2()
50EndFunc
51
52Func Chain2()
53        For $i = 0 To 10000
54                ConsoleWrite("")
55        Next
56        Chain3()
57EndFunc
58
59Func Chain3()
60        For $i = 0 To 10000
61                ConsoleWrite("")
62        Next
63        Chain4()
64EndFunc
65
66Func Chain4()
67        For $i = 0 To 10000
68                ConsoleWrite("")
69        Next
70        Chain5()
71EndFunc
72
73Func Chain5()
74        For $i = 0 To 10000
75                ConsoleWrite("")
76        Next
77;       Return 1
78EndFunc