I have tried this
I hope this is what you want
#NoTrayIcon
Opt('GUIOnEventMode', 1)
Global $hGui = GUICreate("Dummy Gui", 0, 0, -200, -200, -1, 0, WinGetHandle(AutoItWinGetTitle()))
GUISetState()
Global $Context = GUICtrlCreateContextMenu(GUICtrlCreateDummy())
Global $step1 = GUICtrlCreateMenuItem("&step1", $Context)
GUICtrlSetOnEvent(-1, '_Hello')
GUICtrlCreateMenuItem("", $Context)
Global $step2 = GUICtrlCreateMenu("&step2", $Context)
Global $step2_1 = GUICtrlCreateMenuItem("&step2_1", $step2)
GUICtrlSetOnEvent(-1, '_HowAreYou')
GUICtrlCreateMenuItem("", $Context)
Global $step3 = GUICtrlCreateMenu("&step3", $Context)
Global $step3_1 = GUICtrlCreateMenuItem("&step3_1", $step3)
Global $step3_2 = GUICtrlCreateMenuItem("&step3_2", $step3)
TrackPopupMenu($hGui, GUICtrlGetHandle($Context), MouseGetPos(0), MouseGetPos(1))
; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd)
Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
EndFunc ;==>TrackPopupMenu
Func _Hello()
MsgBox(0, "Hello", "Hello")
EndFunc
Func _HowAreYou()
MsgBox(0, "How Are You", "How Are You")
EndFunc