#include "xheaders.h"

#include XMessageBox_i
#include XWindow_i
#include XString_i
#include XResource_i
#include XResourceLibrary_i


USHORT XMessageBox :: GetCommand( void )
{ return res; }


XMessageBox :: XMessageBox(const char * s1, const char * s2, ULONG style, XWindow * owner, ULONG id)
{
   const char * s3 = s2;
   if(!(s3))
      s3 = "";
   OOL_WINDOWHANDLE hwnd = ( owner ? owner->GetHandle() : HWND_DESKTOP);
   if(id) style |= MB_HELP;
   res = WinMessageBox(HWND_DESKTOP, hwnd, (PSZ) (char*) s1, (PSZ) (char*) s3, id, style);
}


XMessageBox :: XMessageBox( XResource ms1, XResource ms2, ULONG style, XWindow * owner, ULONG id)
{
   XString s1, s2 = "";

   ms1.library->LoadString( &s1, ms1.id );
   if(ms2.id > 0)
      ms2.library->LoadString( &s2, ms2.id);
   OOL_WINDOWHANDLE hwnd = ( owner ? owner->GetHandle() : HWND_DESKTOP);
   if(id) style |= MB_HELP;
   res = WinMessageBox(HWND_DESKTOP, hwnd, (PSZ) (const char*) s1, (PSZ) (const char*) s2, id, style);
}


