Advertisement
vytenis555

GenericMB - C++

Apr 20th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <Windows.h>
  2.  
  3. template <class TYPE>
  4. void GenericMB(bool bError, TYPE tMessage)
  5. {
  6.     MessageBoxA(NULL, tMessage, (bError ? "Error" : "Information"), MB_OK | MB_TOPMOST | (bError ? MB_ICONERROR : MB_ICONINFORMATION));
  7. }
  8.  
  9. int main()
  10. {
  11.     GenericMB(true, "GetLastError(): " + GetLastError());
  12.     GenericMB(false, "Some information box.");
  13.  
  14.     system("pause");
  15.     return EXIT_SUCCESS;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement