MessageRequester Flags, overview
Posted: Sun Jan 12, 2003 1:35 am
Code updated For 5.20+
Restored from previous forum. Originally posted by Danilo.
cya,
...Danilo
(registered PureBasic user)
Restored from previous forum. Originally posted by Danilo.
Code: Select all
;
; 14.11.2002 - by Danilo for german forum
; 12.01.2003 - by Danilo, translated for english forum
;
;
; Flags for MessageRequester(Title$, Text$, Flags)
; -------------------------------------------------
;
; - only available on PureBasic /Windows
; - API: MessageBox_() & MessageBoxEx_()
;
;
; [ Button Types ]
;
; #MB_OK = [OK] ( --> 0 = default )
; #MB_OKCANCEL = [OK] [Cancel]
;
; #MB_YESNO = [Yes] [No]
; #MB_YESNOCANCEL = [Yes] [No] [Cancel]
;
; #MB_RETRYCANCEL = [Retry] [Cancel]
;
; #MB_ABORTRETRYIGNORE = [Abort] [Retry] [Ignore]
; #MB_CANCELTRYCONTINUE = [Cancel] [Retry] [Continue] - (Windows 98/2000+)
;
; #MB_HELP = [Help] --> Help-Button (Windows NT4/95+)
; Pressing this Button sends a '#WM_HELP'
; message to your program event handler (callback).
;
; [ Icons (Images) ]
;
; #MB_ICONSTOP = Icon (X) : Stop
; #MB_ICONERROR = Icon (X) : Stop (NT4/95+)
; #MB_ICONHAND = Icon (X) : Stop
;
; #MB_ICONQUESTION = Icon (?) : Question
;
; #MB_ICONASTERISK = Icon (i) : Information
; #MB_ICONINFORMATION = Icon (i) : Information
;
; #MB_ICONWARNING = Icon (!) : Warning (NT4/95+)
; #MB_ICONEXCLAMATION = Icon (!) : Warning
;
; [ Default Button ]
;
; #MB_DEFBUTTON1 = 1. Button is 'default' (selected)
; #MB_DEFBUTTON2 = 2. Button is 'default' (selected)
; #MB_DEFBUTTON3 = 3. Button is 'default' (selected)
; #MB_DEFBUTTON4 = 4. Button is 'default' (selected) - (NT4/95+)
;
; [ Priority ]
;
; #MB_APPLMODAL = User must click the messagebox before
; he can continue using the program. (default)
; #MB_SYSTEMMODAL = User must click the messagebox before
; he can continue using the program.
; This should only be used if a big general
; error occured, like 'out of memory' for example.
;
; #MB_TASKMODAL = Same as #MB_APPLMODAL (in general), but other
; Windows of the same Task get disabled too.
;
; [ Miscellaneous ]
;
; #MB_RIGHT = All Text right aligned - (Windows NT4/95+)
; #MB_SETFOREGROUND = The MsgBox comes to foreground
; (internal SetForegroundWindow_() gets called)
; #MB_TOPMOST = MsgBox is the topmost window ('Stay-on-Top') - (Windows NT4/95+)
; #MB_SERVICE_NOTIFICATION = The Program is a Windows-Service and the MsgBox
; is also shown if no user is logged in. - (Windows NT 4.0+ only)
; #MB_RTLREADING = Window is mirrored on its Y axis.
; (for Hebrew and Arabic systems) - (Windows NT4/95+)
;
;
;
; [ Return values ]
;
; #IDYES = Yes
; #IDNO = No
; #IDOK = OK
; #IDABORT = Abort
; #IDCANCEL = Cancel
; #IDCONTINUE = Continue ; (Windows 98/2000+)
; #IDIGNORE = Ignore
; #IDRETRY = Retry
; #IDTRYAGAIN = Try again ; (Windows 98/2000+)
; 0 = Error,
; cant display MessageBox
;
;
#MB_CANCELTRYCONTINUE = $00000006 ; (Windows 2000+)
#MB_HELP = $00004000 ; (Windows NT4/95+)
#MB_DEFBUTTON4 = $00000300 ; (Windows NT4/95+)
#MB_RIGHT = $00080000 ; (Windows NT4/95+)
#MB_TOPMOST = $00040000 ; (Windows NT4/95+)
#MB_SERVICE_NOTIFICATION = $00040000 ; (Windows NT 4.0+)
#MB_RTLREADING = $00100000 ; (Windows NT4/95+)
#IDCONTINUE = $0000000B ; (Windows 98/2000+)
#IDTRYAGAIN = $0000000A ; (Windows 98/2000+)
Select MessageRequester("ERROR", "Cant read file 'xyz' !", #MB_ABORTRETRYIGNORE | #MB_ICONSTOP | #MB_DEFBUTTON2)
Case #IDYES : Result$ = "Yes"
Case #IDNO : Result$ = "No"
Case #IDOK : Result$ = "OK"
Case #IDABORT : Result$ = "Abort"
Case #IDCANCEL : Result$ = "Cancel"
Case #IDCONTINUE : Result$ = "Continue" ; (Windows 98/2000+)
Case #IDIGNORE : Result$ = "Ignore"
Case #IDRETRY : Result$ = "Retry"
Case #IDTRYAGAIN : Result$ = "Try again" ; (Windows 98/2000+)
EndSelect
MessageRequester("Your Selection:",Result$,0)
...Danilo
(registered PureBasic user)