MessageBox.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef MESSAGEBOX_H
  2. #define MESSAGEBOX_H
  3. /*************************************************************************************************\
  4. MessageBox.h : quick helper function to call up a message box
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. #ifndef UTILITIES_H
  10. #include "Utilities.h"
  11. #endif
  12. #include "EditorInterface.h"
  13. #include "stdafx.h"
  14. //*************************************************************************************************
  15. /**************************************************************************************************
  16. CLASS DESCRIPTION
  17. MessageBox:
  18. **************************************************************************************************/
  19. extern unsigned long gameResourceHandle;
  20. inline int EMessageBox(int MessageID, int CaptionID,DWORD dwS )
  21. {
  22. char buffer[512];
  23. char bufferCaption[512];
  24. cLoadString( MessageID, buffer, 512, gameResourceHandle );
  25. cLoadString( CaptionID, bufferCaption, 512, gameResourceHandle );
  26. if (EditorInterface::instance() && EditorInterface::instance()->ThisIsInitialized())
  27. {
  28. return EditorInterface::instance()->MessageBoxA( buffer, bufferCaption, dwS );
  29. }
  30. else
  31. {
  32. /*note: this messagebox will not be modal wrt the application*/
  33. return ::MessageBoxA( NULL, buffer, bufferCaption, dwS );
  34. }
  35. }
  36. //*************************************************************************************************
  37. #endif // end of file ( MessageBox.h )