it is easy try this code
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 296, 349, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 48, 24, 177, 57)
$Button2 = GUICtrlCreateButton("Button2", 48, 112, 193, 49)
$Button3 = GUICtrlCreateButton("Button3", 40, 192, 201, 49)
$Button4 = GUICtrlCreateButton("Button4", 48, 264, 193, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Local $pressed_1=False
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$pressed_1=True
Case $Button2
if $pressed_1 then
MsgBox(0,"result","2 pressed after 1")
$pressed_1=False
EndIf
Case $Button3
$pressed_1=False
Case $Button4
$pressed_1=False
EndSwitch
WEnd