News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

MessageBox Library

Started by empty, June 12, 2004, 10:59:01 AM

Previous topic - Next topic

empty

PlayBASIC Code: [Select]
;---------------------------------------------------------------------


// FLAGS
Constant MB_ABORTRETRYIGNORE = 2 // The message Box contains three Push buttons: Abort, Retry, And Ignore.
Constant MB_OK = 0 // The message Box contains one Push button: OK. This is the default.
Constant MB_OKCANCEL = 1 // The message Box contains two Push buttons: OK And Cancel.
Constant MB_RETRYCANCEL = 5 // The message Box contains two Push buttons: Retry And Cancel.
Constant MB_YESNO = 4 // The message Box contains two Push buttons: Yes And No.
Constant MB_YESNOCANCEL = 3 // The message Box contains three Push buttons: Yes, No, And Cancel.

Constant MB_ICONWARNING = 48 // An exclamation-Point icon appears in the message box.
Constant MB_ICONINFORMATION = 64 // An icon consisting of a lowercase letter i in a Circle appears in the message box.
Constant MB_ICONQUESTION = 32 // A question-mark icon appears in the message box.
Constant MB_ICONSTOP = 16 // A stop-sign icon appears in the message box.

Constant MB_DEFBUTTON1 = 0 // The first button is the Default button. MB_DEFBUTTON1 is the Default unless MB_DEFBUTTON2, MB_DEFBUTTON3, Or MB_DEFBUTTON4 is specified.
Constant MB_DEFBUTTON2 = 256 // The second button is the Default button.
Constant MB_DEFBUTTON3 = 512 // The third button is the Default button.
Constant MB_DEFBUTTON4 = 768 // The fourth button is the Default button.

// RESULT
Constant IDABORT = 3 // Abort button was selected.
Constant IDCANCEL = 2 // Cancel button was selected.
Constant IDIGNORE = 5 // Ignore button was selected.
Constant IDNO = 7 // No button was selected.
Constant IDOK = 1 // OK button was selected.
Constant IDRETRY = 4 // Retry button was selected.
Constant IDYES = 6 // Yes button was selected.


Function MessageBox(Caption$, Text$, Flags)
MsgDLL = GetFreeDll()
LoadDll "user32.dll",MsgDLL
result = CallDll(MsgDLL,"MessageBoxA",0,Text$,Caption$,Flags+8192)
DeleteDLL MsgDLL
EndFunction result




// DEMO --------------------------------------------------------------------------------
click = MessageBox("Test","Hello World",MB_YESNOCANCEL+MB_ICONQUESTION+MB_DEFBUTTON3)
Select Click
Case IDYES: Print "YES!"
Case IDNO: Print "NO!"
Case IDCANCEL: Print "CANCEL!"
EndSelect
Sync
WaitKey
END
// END DEMO --------------------------------------------------------------------------------





Related To:

      - Windows File Dialogs Library (login required)

      - PlayDialogs Library (login required)