#include<GUIConstants.au3>
$Main=GUICreate("GUI",200,100)
$Menu=GUICtrlCreateMenu("&File")
$New=GUICtrlCreateMenuItem("&New",$Menu)
$button=GUICtrlCreateButton("Btn",20,20,60,20)
GUISetState()
While 1
$Curinfo=GUIGetCursorInfo($Main)
If $Curinfo[3]=1 And $Curinfo[4]=$button Then
MsgBox(0,"","Btn")
EndIf
If $Curinfo[3]=1 And $Curinfo[4]=$New Then
MsgBox(0,"","New")
EndIf
WEnd