This is in fact a bit of a pain. What you need to do is poke the address of the null terminated strings for the caption and text into the parameter block (not the strings themselves). Now you can not just poke a bank address because banks are themselves structures, and although blitz will just pass the bank data when you pass a bank directly to a userlib function, it will not know to do this if you store it in a parameter block. So you will need to poke in the address stored at the bank address + 4 which is where the data is stored. One way of getting that is to use one of those external memory functions. So you could have something like...
In this case I am using the BLZ memory DLL and decls which was posted around here some time since, probably as part of something else. I could email it to you if you do not have it or something similar.
I also came across some constants which you might find useful. I think you may find explanations for them by looking up the MessageboxEx function.
Type MSGBOXPARAMS Field cbSize Field hwndOwner Field hInstance Field lpszText$ Field lpszCaption$ Field dwStyle Field lpszIcon$ Field dwContextHelpId Field lpfnMsgBoxCallback Field dwLanguageId End Type Const IDOK = 1 Const IDCANCEL = 2 Const IDABORT = 3 Const IDRETRY = 4 Const IDCONTINUE = 5 Const IDIGNORE = 5 Const IDYES = 6 Const IDNO = 7 Const MB_APPLMODAL = $0 Const MB_COMPOSITE = $2 Const MB_DEFAULT_DESKTOP_ONLY = $20000 Const MB_DEFBUTTON1 = $0 Const MB_DEFBUTTON2 = $100 Const MB_DEFBUTTON3 = $200 Const MB_DEFMASK = $F00 Const MB_ICONASTERISK = $40 Const MB_ICONEXCLAMATION = $30 Const MB_ICONHAND = $10 Const MB_ICONINFORMATION = MB_ICONASTERISK Const MB_ICONMASK = $F0 Const MB_ICONQUESTION = $20 Const MB_ICONSTOP = MB_ICONHAND Const MB_MISCMASK = $C000 Const MB_MODEMASK = $3000 Const MB_NOFOCUS = $8000 Const MB_OK = $0 Const MB_OKCANCEL = $1 Const MB_PRECOMPOSED = $1 Const MB_RETRYCANCEL = $5 Const MB_SETFOREGROUND = $10000 Const MB_SYSTEMMODAL = $1000 Const MB_TASKMODAL = $2000 Const MB_TYPEMASK = $F Const MB_USEGLYPHCHARS = $4 Const MB_YESNO = $4 Const MB_YESNOCANCEL = $3 Graphics3D 800,600,32,2 While Not KeyHit(1) ;val = MessageBox(GetActiveWindow(),"All Your Base Are Belong To Us","Warning",MB_ICONEXCLAMATION+MB_YESNOCANCEL) mbx.msgboxparams=New msgboxparams mbx\hwndOwner = GetActiveWindow() mbx\lpszText$="What foul creature wakes me from mine slumber?" mbx\lpszCaption$="Warning" mbx\dwStyle=MB_ICONEXCLAMATION+MB_YESNOCANCEL val=DoMessageBoxIndirect(mbx) Print val WaitKey Wend Function doMessageBoxIndirect(mbx.msgboxparams) mbx\cbsize=40 bnk=CreateBank(40) PokeInt (bnk,0,mbx\cbSize) PokeInt (bnk,4,mbx\hwndOwner) PokeInt (bnk,8,mbx\hInstance) strbank1=stringtobank(mbx\lpsztext) PokeInt (bnk,12,BLZPeekInt(strbank1+4)) strbank2=stringtobank(mbx\lpszCaption) PokeInt (bnk,16,BLZPeekInt(strbank2+4)) PokeInt(bnk,20,mbx\dwStyle) PokeInt (bnk,24,0) PokeInt (bnk,28,mbx\dwContextHelpID) PokeInt (bnk,32,mbx\lpfnMsgBoxCallback) PokeInt (bnk,36,mbx\dwLanguageId) val=MessageBoxIndirect(bnk) FreeBank bnk FreeBank strbank1 FreeBank strbank2 Return Val End Function Function Stringtobank(s$,bnk=0) size=Len(s$)+1 If bnk=0 Then bnk=CreateBank(size) Else If BankSize(bnk)<size Then ResizeBank bnk,size EndIf For f=0 To size-2 PokeByte bnk,f,Asc(Mid(s$,f+1,1)) Next PokeByte bnk,f,0 Return bnk End Function
In this case I am using the BLZ memory DLL and decls which was posted around here some time since, probably as part of something else. I could email it to you if you do not have it or something similar.
I also came across some constants which you might find useful. I think you may find explanations for them by looking up the MessageboxEx function.