Error! in code CustomMsgBox.au3 Change.. OnAutoItExitFunction() to OnAutoItExitRegister() For run script sample #include "CustomMsgBox.au3"
While 1
$Return = xMsgBox(16+0x200,"Title","Text","Yes","No","Cancel",Default,34,"C:\Program Files\AutoIt3\Icons\au3.ico")
MsgBox(0, 'ReturnValue:', 'ID Button = '&$Return)
If $Return = 2 Then ExitLoop
WEndOR #include "CustomMsgBox.au3"
Do
$Return = xMsgBox(16+0x200,"Title","Text","Yes","No","Cancel",Default,34,"C:\Program Files\AutoIt3\Icons\au3.ico")
MsgBox(0, 'ReturnValue:', 'ID Button = '&$Return)
Until $Return = 2