November 25, 2020, 05:38:23 AM

Author Topic: [bb] More API Requesters by Kevin_ [ 1+ years ago ]  (Read 645 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] More API Requesters by Kevin_ [ 1+ years ago ]
« on: June 29, 2017, 12:28:38 AM »
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
  1. ; More requesters By Prof
  2.  
  3. ; user32.decls
  4. ; MessageBox%(hWnd,lpText$,lpCaption$,uType):"MessageBoxA"
  5.  
  6. ; Style = 0 ; OK
  7. ; Style = 1 ; OK / CANCEL
  8. ; Style = 2 ; ABORT / RETRY / IGNORE
  9. ; Style = 3 ; YES / NO / CANCEL
  10. ; Style = 4 ; YES / NO
  11. ; Style = 5 ; RETRY / CANCEL
  12. ; Style = 6 ; CANCEL / TRY AGAIN / CONTINUE
  13.  
  14. ; Notice the following return values no matter which Style is used.....
  15. ;
  16. ; 1  means OK        clicked
  17. ; 2  means CANCEL    clicked
  18. ; 3  means ABORT     clicked
  19. ; 4  means RETRY     clicked
  20. ; 5  means IGNORE    clicked
  21. ; 6  means YES       clicked
  22. ; 7  means NO        clicked
  23. ; 10 means TRY AGAIN clicked
  24. ; 11 means CONTINUE  clicked
  25.  
  26. Graphics 640,480,32,2
  27. SetBuffer BackBuffer()
  28.  
  29. STYLE = 6
  30. Result=MessageBox(0,"Popup message","Popup caption",Style)
  31.  
  32. Text 10,10,"Result = "+Str(Result)
  33. Flip
  34.  
  35. Repeat
  36. Until KeyDown(1)
  37. End


Comments :


Blaine(Posted 1+ years ago)

 Also, to use an Icon in the requester, add one of the following to the style:
Code: [Select]
; 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]

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal