' MSGBOX Demo — various styles via MessageBoxA DECLARE
#COMPILE EXE
#DIM ALL

DECLARE FUNCTION MessageBox LIB "USER32.DLL" ALIAS "MessageBoxA" (BYVAL hWnd AS LONG, BYVAL lpText AS ASCIIZ, BYVAL lpCaption AS ASCIIZ, BYVAL uType AS LONG) AS LONG

%MB_ICONINFORMATION = 64
%MB_YESNO = 4
%MB_ICONQUESTION = 32
%MB_ICONERROR = 16

FUNCTION PBMAIN() AS LONG
    BEEP
    MessageBox(0, "This is an information message" + CHR$(0), "Info" + CHR$(0), %MB_ICONINFORMATION)
    MessageBox(0, "Are you sure?" + CHR$(0), "Confirm" + CHR$(0), 36)
    MessageBox(0, "Critical error!" + CHR$(0), "Error" + CHR$(0), %MB_ICONERROR)
    FUNCTION = 0
END FUNCTION
