text is the popup body, caption is the title bar, and flags is a number that packs three things at once: the button set in the low 4 bits, an icon, and which button starts selected. The value passes straight to Win32’s MessageBoxA, so the codes below come from Microsoft’s docs.
Most commonly used to ask the user to confirm before a script does something they can’t undo.
Common button styles (low 4 bits, mutually exclusive):
0- MB_OK: just OK1- MB_OKCANCEL: OK and Cancel3- MB_YESNOCANCEL: Yes, No, and Cancel4- MB_YESNO: Yes and No
0x10- red error0x20- question mark (deprecated by Microsoft but still works)0x30- yellow warning triangle0x40- blue info (i)
flags = 4 + 0x30 opens a Yes/No popup with the warning icon. Default-button selectors (0x100, 0x200, 0x300) and rarer button sets (Abort/Retry/Ignore, Cancel/TryAgain/Continue) live in the Microsoft docs. Learn more here.
Parameters
Returns
number - the Win32 ID constant for the button the user clicked: