win.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "always.h"
  19. #include "win.h"
  20. #include "wwdebug.h"
  21. HINSTANCE ProgramInstance;
  22. HWND MainWindow;
  23. bool GameInFocus = false;
  24. /***********************************************************************************************
  25. * Print_Win32Error -- Print the Win32 error message. *
  26. * *
  27. * INPUT: *
  28. * *
  29. * OUTPUT: *
  30. * *
  31. * WARNINGS: *
  32. * *
  33. * HISTORY: *
  34. * 6/21/01 DEL : Created. *
  35. *=============================================================================================*/
  36. #ifdef _DEBUG
  37. void __cdecl Print_Win32Error(unsigned long win32Error)
  38. {
  39. LPVOID lpMsgBuf;
  40. FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
  41. FORMAT_MESSAGE_IGNORE_INSERTS, NULL, win32Error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
  42. (LPTSTR)&lpMsgBuf, 0, NULL);
  43. WWDEBUG_SAY(("Win32 Error: %s\n", (const char*)lpMsgBuf));
  44. LocalFree(lpMsgBuf);
  45. }
  46. #endif