[bb] More API Requesters by Kevin_ [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:38

Previous topic - Next topic

BlitzBot

Title : More API Requesters
Author : Kevin_
Posted : 1+ years ago

Description : Stick the 'MessageBox%' declaration in user32.decls and you will have more pop up requesters. Have fun.

Code :
Code (blitzbasic) Select
; More requesters By Prof

; user32.decls
; MessageBox%(hWnd,lpText$,lpCaption$,uType):"MessageBoxA"

; Style = 0 ; OK
; Style = 1 ; OK / CANCEL
; Style = 2 ; ABORT / RETRY / IGNORE
; Style = 3 ; YES / NO / CANCEL
; Style = 4 ; YES / NO
; Style = 5 ; RETRY / CANCEL
; Style = 6 ; CANCEL / TRY AGAIN / CONTINUE

; Notice the following return values no matter which Style is used.....
;
; 1  means OK        clicked
; 2  means CANCEL    clicked
; 3  means ABORT     clicked
; 4  means RETRY     clicked
; 5  means IGNORE    clicked
; 6  means YES       clicked
; 7  means NO        clicked
; 10 means TRY AGAIN clicked
; 11 means CONTINUE  clicked

Graphics 640,480,32,2
SetBuffer BackBuffer()

STYLE = 6
Result=MessageBox(0,"Popup message","Popup caption",Style)

Text 10,10,"Result = "+Str(Result)
Flip

Repeat
Until KeyDown(1)
End


Comments :


Blaine(Posted 1+ years ago)

 Also, to use an Icon in the requester, add one of the following to the style:
; Style = Style + $40 ; "i" in information bubble (notify beep)
; Style = Style + $30 ; "!" in yellow triangle (error beep)
; Style = Style + $20 ; "?" in information bubble (no beep)
; Style = Style + $10 ; "X" in red circle (fatal error beep)
Which makes this code far more useful.  :D


Ked(Posted 1+ years ago)

 very cool and useful... now i don't have to wish i had BlitzPlus anymore!! YIPEE!


TAS(Posted 1+ years ago)

 Very handy [/i]