Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. namespace Reaux { namespace OS {
  2.  
  3. // debug message types
  4. enum DebugMessage
  5. {
  6.     DBG_MSG__NOTICE = 0,
  7.     DBG_MSG__WARNING,
  8.     DBG_MSG__ERROR,
  9.     DBG_MSG__TOTAL
  10. };
  11.  
  12. }}
  13.  
  14. // Message output (Microsoft)
  15. namespace Reaux { namespace OS {
  16.     static void OutputMessage(DebugMessage type, pchar msg, ...)
  17.     {
  18.         if (!msg) return;
  19.        
  20.         va_list argList;
  21.         va_start(argList, msg);
  22.        
  23. #ifdef __REAUX_CONSOLE
  24.         vutf8printf(stdout, msg, &argList);
  25. #endif
  26.         char buf[4096]; // 4 kb
  27.         StringCchVPrintf(buf, sizeof(buf), msg, argList);
  28.        
  29.         // Minimize application (If GUI application and FULLCSREEN mode for example...)
  30.         HWND hwnd = FindWindow(REAUX_APPLICATION_WINDOW, NULL);
  31.         if (hwnd)
  32.         {
  33.             ShowWindow(hwnd, SW_MINIMIZE);
  34.         }
  35.        
  36.         // Show message window
  37.         MessageBox(NULL, msg, "Reaux SDK", MB_OK|MB_APPLMODAL|MB_SETFOREGROUND|MB_TOPMOST|MB_ICONERROR);
  38.         if (type == DBG_MSG__ERROR)
  39.         {
  40.             abort();
  41.         }
  42.        
  43.         va_end(argList);
  44.        
  45.         // MiniDupm call...
  46.     }
  47. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement