#include once "window9.bi"

Function MsgBox(ByRef Caption As USTRING, _
				ByRef Message As USTRING, _
				ByVal flag As Integer, _
				ByVal ParentWin as Hwnd = 0) As Integer Export
	
	dim as HWND hwFocus = GetFocus()
	dim as USTRING sCaption
	dim as USTRING sMessage
	If Len(Message) = 0 Then		
		sMessage = " "
	Else
		sMessage = Message
	EndIf
	If Len(Caption) = 0 Then		
		sCaption = " "
	Else
		sCaption = Caption
	EndIf
	dim as Integer iRet
	#ifdef UNICODE
		iRet = MessageBox(ParentWin,*sMessage,*sCaption,flag)
	#else	
		iRet = MessageBox(ParentWin,sMessage,sCaption,flag)
	#EndIf
	SetFocus(hwFocus)
	return iRet	
End Function
