Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

  1. /*****************************************************************/
  2. /** Microsoft Windows for Workgroups **/
  3. /** Copyright (C) Microsoft Corp., 1991-1992 **/
  4. /*****************************************************************/
  5. /* NPMSG.CPP -- Implementation of MsgBox subroutine.
  6. *
  7. * History:
  8. * 05/06/93 gregj Created
  9. */
  10. #include "npcommon.h"
  11. #include "npmsg.h"
  12. #include "npstring.h"
  13. #include <mluisupp.h>
  14. extern "C" {
  15. #include <netlib.h>
  16. };
  17. LPSTR pszTitle = NULL;
  18. int MsgBox( HWND hwndOwner, UINT idMsg, UINT wFlags, const NLS_STR **apnls /* = NULL */ )
  19. {
  20. if (pszTitle == NULL) {
  21. pszTitle = new char[MAX_RES_STR_LEN];
  22. if (pszTitle != NULL) {
  23. MLLoadString(IDS_MSGTITLE, pszTitle, MAX_RES_STR_LEN );
  24. UINT cbTitle = ::strlenf(pszTitle) + 1;
  25. delete pszTitle;
  26. pszTitle = new char[cbTitle];
  27. if (pszTitle != NULL)
  28. MLLoadStringA(IDS_MSGTITLE, pszTitle, cbTitle);
  29. }
  30. }
  31. NLS_STR nlsMsg( MAX_RES_STR_LEN );
  32. if (apnls == NULL)
  33. nlsMsg.LoadString((unsigned short) idMsg );
  34. else
  35. nlsMsg.LoadString((unsigned short) idMsg, apnls );
  36. return ::MessageBox( hwndOwner, nlsMsg, pszTitle, wFlags | MB_SETFOREGROUND );
  37. }