errCheck.cpp 549 B

12345678910111213141516171819202122232425262728293031
  1. #include "Win32.h"
  2. #include "ID.h"
  3. int Err(HWND hwnd, LPCTSTR title, LPCTSTR message)
  4. {
  5. if (!hwnd)
  6. {
  7. MessageBox(NULL, message, title, MB_ICONERROR);
  8. return 1;
  9. }
  10. return 0;
  11. }
  12. int Err(ATOM atom, LPCTSTR title, LPCTSTR message)
  13. {
  14. if (!atom)
  15. {
  16. MessageBox(NULL, message, title, MB_ICONERROR);
  17. return 1;
  18. }
  19. return 0;
  20. }
  21. int Err(LPCTSTR title, LPCTSTR message)
  22. {
  23. if (GetLastError() != 0)
  24. {
  25. MessageBox(NULL, message, title, MB_ICONERROR);
  26. return 1;
  27. }
  28. return 0;
  29. }